Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2007
    Posts
    28

    Unanswered: compare and update a table from one database to another table on another database

    Hi everybody.. need help on this situation which i am to.

    I have two databases named db1 and db2
    both of which has two identical tables named tbl1 and tbl2

    I need to compare tbl1 of db1 to the tbl2 of db2
    if there is a record that is existing on tbl1 and not on the tbl2 then
    i need to create a tblnew on db2
    from that tblnew then i need to append all the data from tblnew to tbl2 of db2.

    I don't know how to start with it because i'm used to appending data on two tables on the same database but not on a different one...

    thanks
    alex

  2. #2
    Join Date
    Jan 2004
    Location
    In a large office with bad lighting
    Posts
    1,040
    Start here or read BOL about 4 part naming:

    http://mssqltips.com/tip.asp?tip=1095

    -- This is all just a Figment of my Imagination --

  3. #3
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Are the databases on the same server? Or Different Server or Instance?

    In any case, read this

    http://weblogs.sqlteam.com/brettk/ar...4/23/1281.aspx
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  4. #4
    Join Date
    Jun 2007
    Posts
    28
    on the same server

    thanks

Posting Permissions

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