With sql Server 2005.
I have declared a trigger that get fired “AFTER INSERT, UPDATE” , in this trigger I’m using a WHILE and a CURSOR to loop on the INSERTED table’s rows.
When I find a row that does not sotisfy a specific condition:
I want the trigger to rise an error and do not insert any of the rows that fired the trigger (not even those that already satisfaied my condition). <— I don’t know how to do this!
Can you tell me how can I rise the error and prevent the insertion?
use rollback