Groups | Blog | Home
all groups > sql server (alternate) > january 2004 >

sql server (alternate) : Automatical table update within a database


emmanuel.keller NO[at]SPAM net2000.ch
1/7/2004 1:14:36 AM
Hello!

We are developping a project using MS-SQLServer 7 and we need a
process for the synchronization of 3 tables together.
Inserts and updates in the table A should immediately and
automatically occur on table C, and updates on table C should also
automatically occur on table B.
We think that the solution using triggers and stored procedures is the
right choice. Could someone with knowledge on stored procedures help
us?
We need the help soon, this is quite urgent, so we’d be happy to
get an answer!
If something is not clear just ask!

Thanks in advance!
Uri Dimant
1/7/2004 11:46:08 AM
Look at CREATE TRIGGER topic in the BOL

[quoted text, click to view]

Mary Bray
1/7/2004 8:48:13 PM
Use triggers if you cannot guarantee that the process that modifies table A
will also do the other two. If you do it all with stored procedures (my
preferred method) you can write the modification code for all three tables
inside the procs. make sure you wrap the 3 statements in a transaction so
they all complete or all roll back. Triggers automatically do the
transaction for you, but this is not always a good thing.



[quoted text, click to view]

AddThis Social Bookmark Button