I have 2 SQL servers. And in the first one I have added the second SQL as a Link Server. When I run an SQL statement on the linked server I get the following message.
Server: Msg 7202, Level 11, State 1, Line 1
Could not find server 'PROD' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.
[OLE/DB provider returned message: Deferred prepare could not be completed.]
The SQL statement that I am runnins is
Select * from openquery(PROD,'Select * from PROD.GMS.dbo.qryDispCL')
But when I run only the SQL statement "Select * from PROD.GMS.dbo.qryDispCL" it works perfect. But I need to have the first statement running.
Please help. Your valuable feedback is greatly appriciated.
It's really strange... You can run this to check registered server:
EXEC sp_helpservers
If the server 'PROD' is not in the result, then run this to add it:
EXEC sp_addlinkedserver 'PROD'
Note: you may need to add login information for the 'PROD' server with 'sp_addlinkedsrvlogin'.
No comments:
Post a Comment