展开全部
create trigger tri_delete
on S
after delete
as
begin
declare @sno int
select @sno=sno from deleted
delete from xk where xk.sno=@sno
end
其中xk是选课表,S是学生表
on S
after delete
as
begin
declare @sno int
select @sno=sno from deleted
delete from xk where xk.sno=@sno
end
其中xk是选课表,S是学生表
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
create trigger test
on 学生表
after delete
if exists(select sno from deleted )
delete 选课表
where sno in
(select 学生ID from deleted)
on 学生表
after delete
if exists(select sno from deleted )
delete 选课表
where sno in
(select 学生ID from deleted)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询