触发器很久没接触了,简单说下思路。 首先肯定是Update 触发器,也就是你修改A表数据时触发,条件就是 SELECT COUNT(1) FROM A WHERE A_2 IS NULL 的结果=0
这个应该没有方式写,除非在程序中判断 A_2 不为null的数量,达到一个值后 执行其它操作语句。
没看懂啥意思。 你是不是当A_2非null时触发某一事件? 触发器不可以在A-2是不是全部非空时触发,只能for inset,update,delete 触发器也可以在某一列字段时触发,下例中表示当A_2变动时触发,比如 if update(A_2) begin end
[quote=引用 5 楼 qaz2499867 的回复:] [quote=引用 4 楼 hanjun0612 的回复:] 可能是这样的 create trigger MyTest on classes for update as declare myCount int =0 select myCount = count(1) from inserted where A_2 is null if (myCount=0) begin 触发 end else 不触发 go
create trigger MyTest on classes for update as declare myCount int =0 select myCount = count(1) from inserted where A_2 is null if (myCount=0) begin 触发 end else 不触发 go
[quote=引用 4 楼 hanjun0612 的回复:] 可能是这样的 create trigger MyTest on classes for update as declare myCount int =0 select myCount = count(1) from inserted where A_2 is null if (myCount=0) begin 触发 end else 不触发 go
可能是这样的 create trigger MyTest on classes for update as declare myCount int =0 select myCount = count(1) from inserted where A_2 is null if (myCount=0) begin 触发 end else 不触发 go
111,092
社区成员
642,554
社区内容
加载中
让您成为最强悍的C#开发者
试试用AI创作助手写篇文章吧