SQL Trigger not working on update statement
-
SQL Trigger not working on update statement hi i am having a table with 3 columns (a,b,c). i have written a trigger for INSERT / UPDATE as c=a+b this is working fine as long as i enter/update each row by row manually. but, when i use any update statement for a set of rows, the trigger is firing only for the last row. can anyone please help? Thanks
-
SQL Trigger not working on update statement hi i am having a table with 3 columns (a,b,c). i have written a trigger for INSERT / UPDATE as c=a+b this is working fine as long as i enter/update each row by row manually. but, when i use any update statement for a set of rows, the trigger is firing only for the last row. can anyone please help? Thanks
Do you know that if an Update statement affects multiple rows, the trigger fires only once, and in the trigger you have to select from the virtual tables INSERTED and DELETED to get the copies of the affected rows.