Unable to connect to server error message | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Unable to connect to server error message

I am running SQL Server 2005 SP1. I have a linked server connection between 2 servers with replication set up. When I run the following, data is returned, no errors: SELECT * FROM [LinkedServer].[DBName].dbo.[TableName] However, when I run the following: EXEC [LinkedServer].[DBName].dbo.[StoredProcName] I get "Could not connect to server ‘ [LinkedServer]’ because ‘[Login]’ is not defined as a remote login at the server. Verify that you have specified the correct login name." Any ideas why the select statement against the linked server works, yet
calling a stored procedure does not? NOTE: It is not just one stored procedure, as I have tested with multiple
stored procedures with the same error.

You have to use sp_addremotelogin to grant the access to remote login…
MohammedU.
Microsoft SQL Server MVP
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.

Take help from this FAQhttp://www.sql-server-performance.com/faq/sqlviewfaq.aspx?faqid=270 in this case. FAQs on this site would help you to get the solution, fyi. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
@http://www.askasqlguru.com/ This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
]]>