Reputation: 11
How can I copy a table to another server. It's a linked server. I used this code, but it is not working.
INSERT INTO [E-SVR].enrollmentCollege.CDDT_MSTR (position_id)
SELECT position_id FROM LETRAN.enrollmentCollege.CDDT_MSTR
Thank you.
Upvotes: 0
Views: 126
Reputation: 43023
When you are using a 4-part name for a table (which you have to so to use a linked server as part of the name), you need to specify the schema (the 3rd part) as well:
INSERT INTO [E-SVR].enrollmentCollege.dbo.CDDT_MSTR (position_id)
SELECT position_id FROM LETRAN.enrollmentCollege.dbo.CDDT_MSTR
If you want to use the default schema, you can leave the schema part empty:
INSERT INTO [E-SVR].enrollmentCollege..CDDT_MSTR (position_id)
SELECT position_id FROM LETRAN.enrollmentCollege..CDDT_MSTR
Upvotes: 0
Reputation: 1
Try this.
INSERT INTO enrollmentCollege..CDDT_MSTR (position_id) SELECT position_id FROM LETRAN.enrollmentCollege..CDDT_MSTR
Upvotes: 0
Reputation: 96
try this.
INSERT INTO [E-SVR].[enrollmentCollege].[dbo].CDDT_MSTR (position_id)
SELECT position_id FROM [LETRAN].[enrollmentCollege].[dbo].CDDT_MSTR
Upvotes: 1