0

I'm trying to insert/update all the 25 tables in destinationDB in SQL Server 2014 from sourceDB which is on SQL Server 2000 based on the recid.

I saw few examples on single table insert using the linked server. Can I update/insert all the tables in the database using below script. I need to do this for all the 25 tables. Any help is appreciated. Thanks

I need to do achieve something like this:

INSERT INTO [DestinationDB]
    SELECT * 
    FROM SourceDB
    LEFT JOIN [DestinationDB] ON DestinationDB.recid = SourceDB.recid
    WHERE Destination.Recid IS NULL
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
LearningMacro
  • 137
  • 1
  • 15
  • 3
    NO. An insert statement is for a specific table. You can't just say insert these tables into those tables. It doesn't make any sense. You might want to look into export/importing data instead of doing this with straight sql. – Sean Lange Jul 31 '15 at 15:06
  • @SeanLange- Thanks for the clarification. – LearningMacro Jul 31 '15 at 17:06

0 Answers0