SQL Server Performance Forum – Threads Archive
Trigger in diff server tableHi all I have a table t1 in db server (d1) and i have a table t2 in db server (d2). I want to create a trigger so that when I insert/delete/update on T1 in server D1 , it has to be updated in T2 in server D2. kindly tell me how to do it and give me the code please. thanx
Why to use trigger, instead you can use replication with Snapshot or transactional type. HTH Satya SKJ
This posting is provided â€œAS ISâ€ with no rights for the sake of knowledge sharing.
My requirement is to create trigger for the above task.
So please help me how to do it. Thanx
Will other processes be updating, inserting, or deleting from D2.T2? If not, then you just need to setup a linked table and write the trigger on T1.D1 FOR UPDATE, INSERT, or DELETE to INSERT from inserted and DELETE from deleted. Look up linked tables and trigger on the index tab in Books Online. It will give you example code to get this done. You need to write the code yourself. It will be good for you. MeanOldDBA
[email protected] When life gives you a lemon, fire the DBA.