Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 15744

Procedural code automatically executed in response to a database event.

3 votes
Accepted

Is it possible to raiserror within a For Delete Trigger that rolls back the deletes

For example, this will work the way you expect: create table T1 ( i1 int ); create table t2 (i2 int primary key); go create trigger T1_ForDelete on T1 for delete as insert into t2 (i2) SELECT … i1 FROM DELETED go insert into T1 (i1) values (1); insert into t2 (i2) values (1); delete from T1; go SELECT * from t1 In the above code the trigger will error, and cause the delete (outer) …
Code Magician's user avatar