Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL task against remote named instance

Status
Not open for further replies.
Jun 19, 2002
294
US
This is probably a simple question and I am just missing the syntax. I need to execute a stored procedure against a database on another server. I have created the linked server and am trying to execute the sql task in DTS using the following:

exec servername.databasename.dbo.storedprocedure

The problem I have is the servername contains a named instance and it will not accept
servername\instance.databasename.dbo.storedprocedure

What is the correct syntax for running a stored procedure against a remote named instance?

Thanks!

 
Like this.
Code:
exec [servername\instance].databasename.dbo.storedprocedure

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
I tried that syntax as well and it returned:

Could not locate entry in sysdatabases for database 'Servername\instance'. No entry found with that name. Make sure that the name is entered correctly. The entry is not in sysdatabases as it is a linked server. The entry is in syservers.

I must be missing something here - just not sure what.

Thanks again for the help with this one.
 
I got it my bad -- left off the .dbo piece. Thanks again for your help - the people on this board are awesome!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top