create trigger CheckDelete on 表 for delete as declare @state nvarchar(20) select @state=isnull(字段,'') from deleted if (@state<>'') begin print('状态不为空 不能删除') rollback //回滚 end
create trigger CheckDelete on 表 for delete as declare @state nvarchar(20) select @state=isnull(字段,'') from deleted if (@state<>'') begin print('状态不为空 不能删除') rollback //回滚 end