1

We have an issue in our database with some rows that have disappeared, so we would like to create an on deleted trigger.

Creating the trigger isn't a problem. The problem is that the rows affected is changed from 1 to 2 whenever we delete a line (row 1 = the actual deleted row, row 2 = the row added to the log by the trigger).

The increased row count is a problem since we have an application where the code is expecting to get rows affected = 1 back. If it gets rows affected = 2 back, the application fails :(

So is there a way to make the rows affected stay = 1, i.e. not count the row added to the log by the trigger.

peterm
  • 91,357
  • 15
  • 148
  • 157
Louisa
  • 552
  • 1
  • 9
  • 22
  • 2
    [`CREATE TRIGGER`](http://technet.microsoft.com/en-us/library/ms189799.aspx): "use a SET NOCOUNT statement at the start of the trigger to prevent the return of any result sets" – Damien_The_Unbeliever Feb 13 '14 at 09:26

0 Answers0