create trigger CheckDelete
onfor delete
as

declare @state nvarchar(20)
select @state=isnull(字段,'') from deleted

if (@state<>'') 
begin
    print('状态不为空 不能删除')
    rollback  //回滚
end

 

相关文章:

  • 2022-01-11
  • 2021-07-12
  • 2022-12-23
  • 2021-09-26
  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
猜你喜欢
  • 2021-08-26
  • 2022-12-23
  • 2022-02-23
  • 2022-12-23
  • 2022-01-19
  • 2022-12-23
  • 2021-09-25
相关资源
相似解决方案