Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2003
    Posts
    34

    Smile Unanswered: Opendatasource problem

    hi to every one....

    To delete records in tableA which is not found in tableB i am using the following :
    DELETE tableA from tableA aa left join tableB bb on aa.fld = bb.fld where bb.fld is null
    ** This will work fine **
    but if i Use similer but using OPENDATASOURCE , like this:

    delete OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\temp\data2004.mdb";
    User ID="Admin";Password="";Jet OLEDBatabase Password="lea"')...tableA
    from OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\temp\data2004.mdb";
    User ID="Admin";Password="";Jet OLEDBatabase Password="lea"')...tableA aa left join tableB bb on aa.lno=ba.lno where b.lno is null

    the result is deleteing whole of TableA.....

    any help is appriciated
    Thanks.
    Last edited by ridwan; 01-12-05 at 04:10.

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Does this syntax work?:

    delete
    from OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0', 'Data Source="c:\temp\data2004.mdb";
    User ID="Admin";Password="";Jet OLEDBatabase Password="lea"')...tableA aa left join tableB bb on aa.lno=ba.lno where b.lno is null
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  3. #3
    Join Date
    Aug 2003
    Posts
    34

    problem in obendatasource

    this will not work , it will give the following error:

    Server: Msg 170, Level 15, State 1, Line 3
    Line 3: Incorrect syntax near 'aa'.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •