December 11, 2012 at 10:16 pm
hello all.
I have two tables.when insert into one ot them with trigger insert into another and with another trigger insert into first table.that means one loop occurs.waht do i do for solve this loop?
December 11, 2012 at 11:17 pm
Explore Update() function to stop this behavior. Refer the link below:
http://msdn.microsoft.com/en-us/library/ms187326.aspx
~ Lokesh Vij
Link to my Blog Post --> www.SQLPathy.com[/url]
Follow me @Twitter
December 11, 2012 at 11:36 pm
thanks for you reply.but please suggest another way.thanks
December 12, 2012 at 9:17 am
Your description is extremely vague to say the least. Do you an insert trigger on Table1 that inserts data into Table2? And you also have an insert trigger on Table2 that inserts into Table1? That is what I think you are saying. This is one of the reasons to try to avoid triggers if at all possible. You can't get out of that loop. You need to come up with a different way of doing whatever these triggers are trying to do.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply