I wanted to perform a simple delete statement like this:
DELETE
FROM table
WHERE table.value = 123
and I am expecting the delete 512 rows from the table since those 512 rows have value 123.
However, there are 5 lines of “xxx rows affected” displayed after running the delete statement.
- The last two lines are identical, “512 lines affected”, which is expected.
- The first “512 rows affected” was the actual deletion.
- The second “512 rows affected” was a trigger(the only delete trigger) inserting 512 rows into table_AUDIT.
What about the first 3 lines of “xxx rows affected”?
I don’t know which tables are affected so I don’t know how to use OUTPUT(googled) to figure out which rows/tables are affected.
My question is: how to display detailed information of the rows deleted? Insert of meaningless “123 rows effected”, I like to see which rows from which tables are deleted.
The best you can do is get a query plan which shall include the triggers. Which rows is something left to your intelligence – query plans generally do not provide this information.