Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoiding multiple cascade paths
Message
From
22/08/2008 15:17:50
 
General information
Forum:
Microsoft SQL Server
Category:
Database design
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01340693
Message ID:
01341224
Views:
15
Hi,

I added a check for @@ROWCOUNT > 0 in the trigger which cured the problem. So would, for instance. a DELETE trigger fire even if there were no actual deletions ?

Regards,
Viv

>A trigger fires once per SQL statement regardless of how many records are affected by the statement.
>You may want or required to take some action in a trigger when 0 record are affected.
>
>>
>>I was looking at using the 'INSTEAD OF' trigger but this in an AFTER is simpler. The only thing that threw me for a while was that the trigger fired when there was nothing to insert (ie INSERT INTO ...... (SELECT ......) caused the trigger to fire even if the select returned no records - that didn't seem very logical to me?
>>
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform