Cristian18
Cristian18

Reputation: 230

Delete trigger is fired when 0 rows are affected

I am using SQL Server and have a issue with delete trigger, because it's fired when there are 0 rows affected(deleted) and i want that it's fire when one row is affected(deleted).

This happen because i am using CASCADE

Upvotes: 1

Views: 418

Answers (1)

Joe Stefanelli
Joe Stefanelli

Reputation: 135809

As pointed out in the documentation:

triggers fire when any valid event is fired, regardless of whether or not any table rows are affected.

Laughing Vergil has given you the solution in his comment.

Upvotes: 3

Related Questions