0

I am on server1 which has a linked server to server2 and server3. This must be done on server1, but I can not get the syntax accurate.

What I want to do is query server2 using OPENQUERY, and insert the results of that query into a new table on server3.

I have tried the following, but no mustard:

SELECT * 
INTO LinkedServer3.dbName 
FROM OPENQUERY(LinkedServer2, 'Select * FROM empInfo') 
  • Did you get an error message? I don't know if your syntax would work (Linked Servers, different RDBMS's, but your INTO only references the server and database. You need to at least specify schema and table in addition. You might try actually doing an INSERT INTO <server>.<database>.<schema>.<table> (<column list>) SELECT <column list> FROM OPEN QUERY(... – Jonathan Fite Jul 28 at 0:55

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.