0

I have two database servers

one is server name: X and other one is server name: Y

I have a table ABC in both databases. I need to copy the data from X server, table ABC to the Y server, table ABC.

I tried this way its giving error.

INSERT INTO [X].Database.dbo.ABC SELECT * FROM [Y].Database.dbo.ABC

but I get this error:

Could not find server 'xxx.xxx.xxx.xxx' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.

1
  • 1
    Have you run sp_addlinkedserver? Commented Oct 27, 2011 at 17:49

3 Answers 3

2

Open up SSMS and point it to Server Y. Right click on database ABC, Tasks -> Import Data. Follow the wizard and point it at your source data in Server X.

Sign up to request clarification or add additional context in comments.

Comments

1

The error is telling you what to do. Use sp_addlinkedserver to create a linked server to the remote server. Then run the query.

Comments

0

First exec procedure:

EXEC sp_addlinkedserver   
@server=N'Y', 
@srvproduct=N'',
@provider=N'SQLNCLI', 
@datasrc=N'Y\instance1';

Then run the query.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.