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 ?
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 ?
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.