日期:2014-05-18 浏览次数:20547 次
create trigger trig_test as if exists(select 1 from tb where charindex('某个字符串',col)>0) rollback
------解决方案--------------------
create trigger tr_name on tb
for insert
as
begin
if(charindex(字符,(select 某个字段 from inserted))>0)
delete tb where id=(select id from inserted)
end