Search Results
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 |
In the database structured query language (SQL), the DELETE statement removes one or more records from a table.
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) …