SQL-SERVER - APPEND from different databse's table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lachmayya
    New Member
    • Aug 2006
    • 1

    SQL-SERVER - APPEND from different databse's table

    Dear All,
    I have created two databases in SQL-SERVER 2000 called Shop1 and Shop2.
    Both database has the table 'Sales' with fields "Item","Rate"," QTY","Price"
    I would like to append data from Shop2 Sales to Shop1 Sales table.

    Your suggestions will be highly appreciated.

    Thank you.

    Lachmayya Siddanmane
    Email: lachmayya@yahoo .co.in
  • goingpostal
    New Member
    • Aug 2006
    • 3

    #2
    Why not use Data Transformation Services (DTS)?

    Comment

    • sasime2
      New Member
      • Dec 2007
      • 2

      #3
      INSERT into table1
      SELECT *
      from table2

      ....have all the fields arraigned in a same order for both tables....make sure both tables have the same field names......

      Comment

      • Jim Doherty
        Recognized Expert Contributor
        • Aug 2007
        • 897

        #4
        Originally posted by Lachmayya
        Dear All,
        I have created two databases in SQL-SERVER 2000 called Shop1 and Shop2.
        Both database has the table 'Sales' with fields "Item","Rate"," QTY","Price"
        I would like to append data from Shop2 Sales to Shop1 Sales table.

        Your suggestions will be highly appreciated.

        Thank you.

        Lachmayya Siddanmane
        Email: lachmayya@yahoo .co.in

        In order to append from one database table to another identical but different database table of the same name and structure you should to reference the database name and owner prefix to the table name as part of the SQL so use this...

        Code:
        INSERT into Shop1.dbo.Sales
        SELECT *
        from Shop2.dbo.Sales

        Regards

        Jim :)

        Comment

        • sasime2
          New Member
          • Dec 2007
          • 2

          #5
          jim is rit..sorry i thought he was askin to append tables in the a same DB

          Comment

          • bxchen
            New Member
            • Jan 2008
            • 7

            #6
            Try DFSTrans, it can transfer data among different database with option append data. here is the web site: www.DirectFocus Software.com

            Comment

            Working...