Showing posts with label tblbcan. Show all posts
Showing posts with label tblbcan. Show all posts

Friday, March 23, 2012

question on trigger/procedure plz reply?

Can it be possible to create trigger/procedure
in following case
2 server server A and server B
A has db1
db1 has tblA

B has db2
db2 has tblB

can it be possible to create trigger on server A.db1.tblA as
insert/update that trigger add/update record in server B.db2.tb2

thnks
----
Hitendra(hitendra15@.gmail.com) writes:
> Can it be possible to create trigger/procedure
> in following case
> 2 server server A and server B
> A has db1
> db1 has tblA
> B has db2
> db2 has tblB
> can it be possible to create trigger on server A.db1.tblA as
> insert/update that trigger add/update record in server B.db2.tb2

Yes, you can set up linked servers with sp_addlinkedserver, and
then use four-part notation to refer to B.db2.dbo.tb2. You will
have to have DTS running on both servers, for it two work.

Notice that this arrangement is likely to have some impact on
concurrency on A.db1.dbo.tblA, as the transaction will run
considerably longer than it would, if the trigger had updated a
local table.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp|||"Erland Sommarskog" <esquel@.sommarskog.se> wrote in message
news:Xns961E39EF36BBYazorman@.127.0.0.1...
> (hitendra15@.gmail.com) writes:
>> Can it be possible to create trigger/procedure
>> in following case
>> 2 server server A and server B
>> A has db1
>> db1 has tblA
>>
>> B has db2
>> db2 has tblB
>>
>> can it be possible to create trigger on server A.db1.tblA as
>> insert/update that trigger add/update record in server B.db2.tb2
> Yes, you can set up linked servers with sp_addlinkedserver, and
> then use four-part notation to refer to B.db2.dbo.tb2. You will
> have to have DTS running on both servers, for it two work.
> Notice that this arrangement is likely to have some impact on
> concurrency on A.db1.dbo.tblA, as the transaction will run
> considerably longer than it would, if the trigger had updated a
> local table.
>
> --
> Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
> Books Online for SQL Server SP3 at
> http://www.microsoft.com/sql/techin.../2000/books.asp

I think you mean you need DTC running on both servers - that one letter
makes a big difference... :-)

Simon|||Simon Hayes (sql@.hayes.ch) writes:
> I think you mean you need DTC running on both servers - that one letter
> makes a big difference... :-)

You're so right, Simon!

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp