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.
| Author |
Topic |
|
jtwork
Yak Posting Veteran
82 Posts |
Posted - 2008-03-31 : 08:41:24
|
| i would like to exec a sp on a different server but not sure how to do this?DECLARE @Cmd VARCHAR(255)DECLARE @Output INTSELECT @Cmd = 'dtsrun /S server /N dtsname /E'EXEC @Output = master..xp_cmdshell @CmdI guess im looking for something similar to the above (but not to run a package) that will let me specify which server and sp name. |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2008-03-31 : 08:44:48
|
You need to add that server as a linked server and then use four-part syntax to execute sp on that server:exec LinkedServer.db1.dbo.TestSP Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-03-31 : 12:22:36
|
| or try with OPENROWSET |
 |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2008-03-31 : 12:25:12
|
| You have to enable Openrowset in SQL server surface area config manager. |
 |
|
|
|
|
|