I’ve read a book For eg., Pro SQL Server 2008 Relation Database Design And Implementation Lois Davidson where I’ve found suggestion to check the @@rowcount inside the trigger: if it is = 0 then return:
if @@rowcount = 0 return
I’m wondering if the no row is modified how come trigger is fired?
The trigger fires for the statement being run. It will fire even if the table is empty, or if the statement affected no rows:
@Muflix Update:
As you see the trigger fires even if no rows were inserted.