Groups | Blog | Home
all groups > sql server (alternate) > february 2006 >

sql server (alternate) : interdatabase trigger possible??


vishnumahendra NO[at]SPAM gmail.com
2/7/2006 10:52:02 PM
Hello to all,

I have say two databases A and B.
A database has tables a1 and a2.
B database has a table b1.

My question is

Can i write a trigger for the table b1, which access the fields from
the table a1 and a2?

Simply, can i write a trigger which access data from other databases?

Thank you in advance,
vishnu
Jens
2/7/2006 10:59:07 PM
Sure for different databases on the same server you can use the
threepart name: Database.Owner.ObjectName (e.g. SELECT * FROM
somedatabase.dbo.SomeTable)

For database on a different server you have to use a linekd server
within the fourpart name: linkedServername.Database.Owner.ObjectName
(e.g. SELECT * FROM linkedServername.Database.Owner.ObjectName )

HTH, jens Suessmeyer.
AddThis Social Bookmark Button