Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

triggers 1

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
could you please tell me how to prevent one trigger from firing another trigger?
 
I presume you mean with circular references -- trigger on table1 updates table2 and a trigger on table2 update table1......

Ideally you should look at this again -- whenever I've come across this it's usually meant that I need to rethink the whole thing.

On the other hand:

add a column to table1 and add check in the table1 trigger so that it only updates table2 when that column is null

in the table2 trigger (that modifies table1) set the new table1 column to some value, 'X' or something. The table1 trigger will pick that up and stop the cycle.

It's the kind of thing that will make your head hurt though -- best to look at the design again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top