Since sql Server 2005. I have declared a trigger that starts "AFTER INSERT, UPDATE", in this trigger I use WHILE and CURSOR to loop in the rows of the INSERTED table. When I find a line that does not satisfy a specific condition:
I want the trigger to raise an error and not insert any of the lines that started the trigger (even those that have already satisfied my state). <--- I do not know how to do this!
Can you tell me how I can raise an error and prevent its installation?
Uince
source
share