Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Add stored procedure to linked server

Author  Topic 

gzadro
Starting Member

4 Posts

Posted - 2010-04-21 : 18:06:58
How can i create stored procedure on linked server?
I had try with this:

USE [UDBV54].master
CREATE PROCEDURE SelectOne
as
Select * From master.dbo.BlockCheck

But i getting this... sql server don't understand that UDBV54 is linked server... help!!
Msg 911, Level 16, State 1, Line 1
Could not locate entry in sysdatabases for database 'UDBV54'. No entry found with that name. Make sure that the name is entered correctly.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-21 : 20:01:42
Put the CREATE PROC code into a sql text file. Then use sqlcmd to execute it on UDBV54:

sqlcmd.exe -Sudbv54 -E -iC:\SomeFolder\SomeFile.sql

You can either use the -d switch to specify the database name or put a USE statement in the sql file.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -