表 DDL:
CREATE TABLE trigtest(a INTEGER IDENTITY(1,1) PRIMARY KEY, b INT)
我目前有
CREATE TRIGGER MaxDelete ON trigtest INSTEAD OF DELETE AS
IF @@rowcount < 1000
DELETE trigtest WHERE a IN (SELECT a FROM deleted)
但是,它要求我以自定义方式为我应用它的每个表编写最后一行
而不是上面的,是否可以写这样的东西:
IF @@rowcount > 1000 (OR SELECT COUNT(*) FROM DELETED)
Kill statement
ELSE
Continue statement
1 个回答