create TRIGGER trigg_test
ON Admin
instead of insert
as
BEGIN
insert into Admin(pwd)
select pwd from inserted k where not exists(select * from Admin where pwd=k.pwd)
END
插入失败判断返回受影响的行数小于=1
>1 是插入成功
ON Admin
instead of insert
as
BEGIN
insert into Admin(pwd)
select pwd from inserted k where not exists(select * from Admin where pwd=k.pwd)
END
插入失败判断返回受影响的行数小于=1
>1 是插入成功