Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Need an example for Indirect Recursive Trigger? Expand / Collapse
Author
Message
Posted Tuesday, December 18, 2012 5:19 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, July 16, 2014 7:38 AM
Points: 2, Visits: 16
hi, I need an example simple indirect recursive trigger.
Thanks.
Post #1397713
Posted Tuesday, December 18, 2012 5:32 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: 2 days ago @ 2:20 AM
Points: 5,231, Visits: 5,106
Simple thing would be imagine 2 tables, with 1 column.

Trigger on each table after the insert of a value into the column

Insert into Tab1 fires Trig1 which inserts the value into Tab2.

Tab2 trigger fires which inserts the value back to Tab1, which caused the trigger to fire on Tab1

And it goes on and on and on in an endless loop

http://msdn.microsoft.com/en-us/library/ms190739%28v=sql.100%29.aspx




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1397717
Posted Wednesday, December 19, 2012 12:47 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Monday, September 15, 2014 7:19 PM
Points: 7,127, Visits: 12,655
jmohan1984.tn.ind (12/18/2012)
hi, I need an example simple indirect recursive trigger.
Thanks.
Did you make it beyond the phone interview?


__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Post #1398631
Posted Wednesday, December 19, 2012 5:35 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 6:49 PM
Points: 3,648, Visits: 5,326
opc.three (12/19/2012)
jmohan1984.tn.ind (12/18/2012)
hi, I need an example simple indirect recursive trigger.
Thanks.
Did you make it beyond the phone interview?


ROTFLMAO! +1



My mantra: No loops! No CURSORs! No RBAR! Hoo-uh!

My thought question: Have you ever been told that your query runs too fast?

My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.


Need to UNPIVOT? Why not CROSS APPLY VALUES instead?
Since random numbers are too important to be left to chance, let's generate some!
Learn to understand recursive CTEs by example.
Splitting strings based on patterns can be fast!
Post #1398720
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse