0

MSSQL - I am trying to append data from Table 1 that doesn't exist in Table 2. The tables have the same columns. One of the columns is image format and is not 'comparable'. Table 2 is across a linked server. The primary key consists of 3 columns.

INSERT INTO Link.DB2.dbo.Table2
SELECT * FROM DB1.dbo.Table1 T1
EXCEPT
SELECT * FROM Link.DB2.dbo.Table2 T2
WHERE T1.Col1 = T2.Col1 and T1.Col2 = T2.Col2 and T1.Col3 = T2.Col3

I know this won't work but just trying to explain what I need to do. I am unable to do a linked server from the destination database.

How would I format this type of statement?

2
  • "I know this won't work..." - Why?...are you receiving a specific error and if so what?
    – J.D.
    Nov 8 at 2:33
  • Please consider following these suggestions.
    – mustaccio
    Nov 8 at 12:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.