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 Help!

Author  Topic 

gems
Starting Member

19 Posts

Posted - 2007-08-07 : 09:21:01
Hi All,

This is my first time writing a trigger in SQL Server 2000. Needed some guidance. I have a table(table1) with exact same copy(table2) in a different database. The only difference in the table structure being that two fields from table1 are concatenated into one in table2.
I want to write a trigger that will keep table2 in sync with table1. Whether it's an insert, delete or an update on table1, table2 should be the same. How can I do that?

Thx

-G

blindman
Master Smack Fu Yak Hacker

2365 Posts

Posted - 2007-08-07 : 10:11:10
The scope of a trigger should be limited to the database in which it resides. Do not use triggers to directly transfer data.
User replication, or mirroring. Or use a trigger to populate a staging table and then periodically copy the data from the staging table to your destination database.

e4 d5 xd5 Nf6
Go to Top of Page
   

- Advertisement -