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
 General SQL Server Forums
 New to SQL Server Programming
 Trigger on linked server

Author  Topic 

OyBosEnEmm
Starting Member

1 Post

Posted - 2012-08-08 : 05:06:56
I need a trigger that insert into another database table on a separate server i.e i have server01, server02 and also a db called 'friendinfo' on each with table 'contact' on both. I want a trigger that will fire after insert on server01 and populate server02 with same records. Thanks experts!

'Boss

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-08-08 : 06:53:20
I have never tried to create a trigger that updates/inserts into a table on another server, so I don't even know if that is possible. Even if possible, that does not sound like a good idea on the face of it. Two technologies that you might want to consider if your objective is to populate a table on a remote server with data on a local server are:

a) Replication - see here: http://msdn.microsoft.com/en-us/library/aa337437(v=sql.105).aspx

b) Service Broker - http://msdn.microsoft.com/en-us/library/ms345108(v=sql.90).aspx

Each requires educating yourself and some planning and efforts, but I think either of them will be more reliable than a cross-server trigger.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-08-08 : 09:42:24
sounds like transaction replication to me

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -