Merging 2 tables?

  • I need to merge 2 tables on a nightly basis.  The tables are in separate databases.  It is best to use transactional merge replicataion or should I use a DTS package?  Can I even use a DTS package without adding more columns etc?

    thanks

  • Try example.

    insert into jobs1 (job_id, job_desc, min_lvl, max_lvl)

    select b.job_id, b.job_desc, b.min_lvl, b.max_lvl

      from pubs..jobs b

     where b.job_id not in (select a.job_id from jobs1 a)

     

  • If the databases are on the same server, I would just use a insert like Allen Cui mentioned above.

    If the databases are on different servers, but in the same physical location (like they are both in the same room / building). Add a linked server, and then use an insert like above (just prepend the server name in the select eg: servername.databasename.dbo.tablename).

    If the databases are on different servers, but a have a slow/unreliable/big distance between them, use a merge replication, but only if you have to! They are more a pain in the ass then anything.

     


    Julian Kuiters
    juliankuiters.id.au

  • It is to run over an Internet connection.  Can you please tell me why Merge Replication is the better choice in this instance then if for the other scenerios it is such a bad choice.

    thanks

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply