触发器如下:目的是禁止删除表中内容,级联字段一定要,不能去掉,有办法改进吗
CREATE TRIGGER candel来款
ON dbo.来款
instead of DELETE 
AS
declare @bh as char(20)
if exists(select * from deleted where  来款 is not null or 客户id is not null)
begin
raiserror ('非法操作,请联系管理员!',16,1)
rollback tran
end
elsebegin
select @bh= 客户id  from deleted
if  exists(select *  from 来款 where 客户id=@bh)
delete  from 来款 where  客户id=@bh
end