cancel the 'triggering' operation

  • hello

    how can i cancel the operation that triggered.. a trigger in some cases?

    say i have an after insert trigger for a Students(id int, name varchar(15)) table and if i try to insert a student with an empty name i want the trigger to raise an error and cancel the insert operation.

    thank you

  • laailalalaa (5/4/2009)


    hello

    how can i cancel the operation that triggered.. a trigger in some cases?

    say i have an after insert trigger for a Students(id int, name varchar(15)) table and if i try to insert a student with an empty name i want the trigger to raise an error and cancel the insert operation.

    thank you

    I'd look at creating a constraint for this instead of a trigger. Look up CONSTRAINTS in Books On-Line (BOL). If, after reading about them and you still have questions just let us know.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply