Reputation: 16204
I have a trigger FOR INSERT and I need to stop the insertion by raising a error.
RAISERROR
will show the error message but is there is a way to halt the action any other method without transactions ?
Upvotes: 0
Views: 445
Reputation: 107716
You have the trigger in the wrong place.
You need an INSTEAD OF trigger instead (no pun intended) to control it. A FOR INSERT trigger occurs AFTER the insert, so the horse has long bolted.
Upvotes: 5