Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003

    Unanswered: UPDATE Table from a remote DB OR INSERT if doesnt excists.

    I have been looking for a solution for this for some time and have came up empty handed.

    I have 2 servers development box and a live box. Time has passed and my live box has a lot of new data in the database and now I need to update the dev box so I can properly test with real data. Problem here is I want to keep the records that are in the dev box, update them if they exsist on the live box, because live server may or may not contain that record and isert all records that are not on the dev box database.

    I hope I am making some sense here, I think I am just making it more difficult then it has to be.

    Any suggestions?


  2. #2
    Join Date
    Nov 2003
    Ok, I have managed to get results that I need but I hope there is still a more intelligent way of doing this...

    I copied all the tables from live box into the dev server with slightly different name, then did something like this ....
    SELECT * INTO newTableOnDEV
    FROM oldTableOnDEV
    WHERE oldTableOnDEV.someID
    NOT IN (SELECT newTableOnDEV.ID from newTableOnDEV )

Posting Permissions

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