Reply to Re: Nested Triggers

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация