Saturday, November 17, 2012 6:15 PMI am having trouble executing a stored procedure on a remote server. On my
local server, I have a linked server setup as follows:
This works fine on my local server:
Select * From [Server1.abcd.myserver.com\SQLServer2005,1563].DatabaseName.dbo.TableName
This does not work (Attempting to execute a remote stored proc named 'Data_Add':
Exec [Server1.abcd.myserver.com\SQLServer2005,1563].DatabaseName.Data_Add 1,'Hello Moto'
When I attempt to run the above, I get the following error:
Could not locate entry in sysdatabases for database 'Server1.abcd.myserver.com\SQLServer2005,1563'.
No entry found with that name. Make sure that the name is entered correctly.
Could anyone shed some light on what I need to do to get this to work?
Saturday, November 17, 2012 11:04 PMModerator
With 3-part names, the first name part is interpreted as a database name instead of a server name. Try adding the schema name (dbo) before the stored procedure name:
EXEC [Server1.abcd.myserver.com\SQLServer2005,1563].DatabaseName.dbo.Data_Add 1,'Hello Moto';
Dan Guzman, SQL Server MVP, http://weblogs.sqlteam.com/dang/