Author |
Topic |
Pete_N
Posting Yak Master
181 Posts |
Posted - 2013-06-13 : 08:07:26
|
I have two SQL ServersServer 1 SQL2008 R2Server 2 SQL2008 R2Is it possible for SERVER 1 to execute a stored Procedure on Server 2 and if so how? |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-06-13 : 08:21:22
|
If you had another server as linked server, then you can execute..1) SERVER1 should have linked server connection to SERVER2...2) from server1 you can execute procedure which is in SERVER2 by using fully qualified name (SERVER1.DBName.SchemaName.ProcedureName )--Chandu |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2013-06-13 : 08:28:37
|
quote: Originally posted by bandi If you had another server as linked server, then you can execute..1) SERVER1 should have linked server connection to SERVER2...2) from server1 you can execute procedure which is in SERVER2 by using fully qualified name (SERVER2.DBName.SchemaName.ProcedureName )--Chandu
Too old to Rock'n'Roll too young to die. |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-06-13 : 08:29:44
|
It was a typo.........quote: Originally posted by webfred
quote: Originally posted by bandi If you had another server as linked server, then you can execute..1) SERVER1 should have linked server connection to SERVER2...2) from server1 you can execute procedure which is in SERVER2 by using fully qualified name (SERVER2.DBName.SchemaName.ProcedureName )--Chandu
Too old to Rock'n'Roll too young to die.
--Chandu |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2013-06-13 : 08:32:16
|
I know quote: Originally posted by bandi It was a typo.........quote: Originally posted by webfred
quote: Originally posted by bandi If you had another server as linked server, then you can execute..1) SERVER1 should have linked server connection to SERVER2...2) from server1 you can execute procedure which is in SERVER2 by using fully qualified name (SERVER2.DBName.SchemaName.ProcedureName )--Chandu
Too old to Rock'n'Roll too young to die.
--Chandu
Too old to Rock'n'Roll too young to die. |
|
|
Pete_N
Posting Yak Master
181 Posts |
Posted - 2013-06-13 : 08:39:32
|
cheers guys, will try that now |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
|
Pete_N
Posting Yak Master
181 Posts |
Posted - 2013-06-13 : 09:05:20
|
Hi guys,i have tried that and come up with this errorThe operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "SERVER 2" was unable to begin a distributed transactionOn server 1 I have a triggerALTER TRIGGER [dbo].[CRM_Customer_Add] ON [dbo].[tbCBI_client] AFTER INSERTAS BEGIN SET NOCOUNT ON; DECLARE @nLicence varchar(6) Select @nLicence = Licence from Inserted EXEC [SERVER 2].[MYDATABASE].[dbo].[Exec_DTSXRunner] @licence = @nLicenceENDExec_DTSXRunner fires a dtsx. If i execute Exec_DTSXRunner direct from Server 2 it works fine. |
|
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
|
|