sql-server数据库中利用触发器实现表与表之间的级联删除

时间:2021-07-14 19:46:06
create trigger Delete_Student --创建一个触发器
on student
instead of delete
as
declare @sno varchar()
select @sno= sno from deleted
delete from score where sno=@sno
delete from student where sno=@sno
go
delete from Student where Sno=''
select *from Student
select *from Score