建立一个触发器,当向sc表中添加数据时,如果添加的数据与student表中的数据不匹配(没有对应的学号),则将此数据删除。

create trigger SC_sc on SC

for insert

as

begin

declare @bh char(9)

select @bh=INSERTED.sno from INSERTED

if not exists(select sno from student where [email protected])

delete from SC where [email protected]

end

触发器实验

相关文章:

  • 2021-09-07
  • 2021-09-07
  • 2021-09-07
  • 2021-12-01
  • 2021-09-02
  • 2021-08-13
  • 2021-09-07
  • 2021-08-17
猜你喜欢
  • 2021-07-05
  • 2021-09-07
  • 2021-09-17
  • 2021-09-07
  • 2021-09-07
  • 2021-09-07
  • 2021-09-07
  • 2021-09-07
相关资源
相似解决方案