创建一个触发器,当删除一个学生信息时,删除成绩表中所有有关该学生的信息。
3个回答
展开全部
Student表:StudentID,StudentName
StudentCJ表:StudentID,StudentCJ
触发器:
CREATE TRIGGER [Delete_student] ON [dbo].[Student]
FOR DELETE
AS
begin
declare @StudentID int
select @StudentID=StudentID from deleted
delete from StudentCJ where StudentID=@StudentID
end
有问题可以追问或Hi我。
StudentCJ表:StudentID,StudentCJ
触发器:
CREATE TRIGGER [Delete_student] ON [dbo].[Student]
FOR DELETE
AS
begin
declare @StudentID int
select @StudentID=StudentID from deleted
delete from StudentCJ where StudentID=@StudentID
end
有问题可以追问或Hi我。
百事牛
2024-10-28 广告
2024-10-28 广告
要取消Excel表格的密码,如果您知道密码,最直接的方式是在打开文件后,点击“文件”>“信息”,然后找到“保护工作簿”下的“用密码进行加密”。在弹出的对话框中,删除已设置的密码,点击“确定”并保存更改即可。若忘记密码,您可能需要考虑使用专业...
点击进入详情页
本回答由百事牛提供
展开全部
语句
create trigger del on 学生表
for delete
as
begin
delete from 成绩表
where studentid in (select studentid from deteled)
end
create trigger del on 学生表
for delete
as
begin
delete from 成绩表
where studentid in (select studentid from deteled)
end
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
create or replace trigger tr1
before delete on XSB
for each row
begin
delete from CJB where CJB.xh=:old.xh;
end;
/
before delete on XSB
for each row
begin
delete from CJB where CJB.xh=:old.xh;
end;
/
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询