Posted by Erland Sommarskog on 12/03/05 12:39
Mark Flippin (me321701@comcast.net) writes:
> Regardless of the order (and I haven't set the first trigger so the
> order is undefined) I would expect that my second trigger would
> execute only once; that after one execution, there are no rows with
> the old invoice number and its execution would NOT initiate the first
> trigger.
As if the trigger would care about that. :-)
Add this to both triggers:
IF @@rowcount = 0
RETURN
Triggers fires even if no rows are affected.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Navigation:
[Reply to this message]
|