sql server – Understanding triggers in Azure SQL database
I have set up a trigger on a table in an Azure SQL database. This trigger is configured to fire on INSERT operations, and it triggers a stored procedure whenever an insert occurs.
I would like to understand the behavior when inserting multiple rows into the table using a single INSERT statement, like in the example below:
INSERT INTO table
SELECT 1, 2
UNION
SELECT 3, 4
UNION
SELECT 4, 5;
In this case, will the trigger (and subsequently the stored procedure) execute only once for the entire INSERT statement, or will it execute three times, once for each row inserted?
Read more here: Source link
