请帮个忙!这个触发器实现了一个什么功能
create trigger deltrigger on employee fordelete
as
if @@rowcount=0
return
if @@rowcount>1
begin
rollback transaction
raiserror('you can only delete one information at one time',16,1)
end
return
raiserror 拼写是对的,我删除三条记录,他也能成功
什么时候会弹出raiserror('you can only delete one information at one time',16,1)的提示信息,if @@rowcount=0
return不理解,
if @@rowcount>1
begin
rollback transaction
raiserror('you can only delete one information at one time',16,1)
end
是说删除的行数大于一行的话就执行begin----end 中的语句麻?还是另有意思?
我一次删除三条它都不告警呀!