I need to copy data from a table on one server to the same table on another server. I tried this:
sp_addlinkedserver 'server1'
INSERT INTO [server2].[R2Op].dbo.[RefR2Ops]
SELECT * FROM server1.[R2Op].dbo.[RefR2Ops]
But I am getting an error on the second statement:
Login failed for user ‘NT AUTHORITY\ANONYMOUS LOGON’.
Could you please tell how I can fix that?
Thanks.
The answer is there. You have not given rights for the local service use to login remote server. You’re command is running as default under the rights of NT AUTHORITY\ANONYMOUS LOGON.
you need to specfy the user credentials to access the linked server
see sp_addlinkedsrvlogin