This is more of a general question but the motivation for this question was a problem I faced while using SQL Server.
I have this trigger attached to an Insert event on a table that contains some logic that, as a side effect, would raise error if no rows were inserted. Upon further investigation, I discovered that the trigger was firing despite no rows being inserted.
The language used in the Microsoft Docs on DML Triggers seems to contradict this behavior:
DML triggers is a special type of stored procedure that automatically takes effect when a DML event takes place that affects the table or view defined in the trigger.
Is this a default behavior across DBMSs? Is there a particular reason to fire a trigger when no rows are affected?