Hi everyone, I am trying to figure out how to copy data from one table to another database table. I have two connections to two different databases. They are called comp-DEV1 and other SQLTEST. Currently, I cannot copy data from my sort table (SQLTEST) to the destination table (comp-DEV1).
This is mistake:
Msg 102, Level 15, State 1, Line 2 Incorrect syntax near '-'.
Query:
INSERT INTO comp-DEV1.EMSSQL.dbo.tblCL SELECT * FROM SQLTEST.EMSSQL.dbo.tblCL WHERE NOT EXISTS(SELECT * FROM comp-DEV1.EMSSQL.dbo.tblCL WHERE (SQLTEST.EMSSQL.dbo.tblCL.CID = comp-DEV1.EMSSQL.dbo.tblCL.CID) )
Any help would be great: o)
David
source share