当前位置: 代码迷 >> Sql Server >> 编纂一个触发器,如果std_score表中Place不为空,则不允许删除本条记录
  详细解决方案

编纂一个触发器,如果std_score表中Place不为空,则不允许删除本条记录

热度:31   发布时间:2016-04-24 18:34:34.0
编写一个触发器,如果std_score表中Place不为空,则不允许删除本条记录。
编写一个触发器,如果std_score表中Place不为空,则不允许删除本条记录。
求详细语句,谢谢!
------解决方案--------------------
create trigger dbo.trigger_std_score_delete
on dbo.std_score
for delete
as

if exists(select * from deleted where Place is not null)
   rollback

go