日期:2014-05-17 浏览次数:20420 次
create table tb(a int not null ,b int not null ,c int)
go
create trigger dbo.trigger_insert_tb
on tb
for insert,update
as
if (select COUNT(*)
from inserted i
inner join tb t
on t.a = i.a and t.b = i.b) >= 2
rollback
if (select COUNT(*)
from inserted i
inner join tb t
on t.a = i.a and t.c = i.c) >= 2
rollback
go