SQL觸發器聯級刪除

Create TRIGGER [dbo].[trigInstructionsDelete]
ON dbo.Instructions
 instead OF DELETE
AS 
BEGIN
	DECLARE @InsId INT
	SELECT @InsId=InstructionsID FROM deleted
	--删除
	   DELETE dbo.Transfer WHERE InstructionsID=@InsId
	DELETE dbo.Instructions WHERE InstructionsID=@InsId

END 

 

posted @ 2013-08-16 10:47  xw2cc  阅读(188)  评论(0编辑  收藏  举报