set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Description: 删除类别触发器
-- =============================================
ALTER TRIGGER [dbo].[trigDelete]
ON [dbo].[tb_Course]
instead of DELETE
AS
BEGIN
declare @ID int
select @ID = ID from deleted
--删除评论
delete tb_Content where OutlineID in (select ID from tb_Outline where CourseID=@ID)
--删除新闻
delete tb_Outline where CourseID=@ID
--删除类别
delete tb_Course where ID=@ID
END
阅读(521) | 评论(0) | 转发(0) |