发表评论
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。
USE [CAprj]
GO
/****** Object: Trigger [dbo].[TB_LogInfo_Delete] Script Date: 08/24/2009 16:57:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER TRIGGER [dbo].[TB_LogInfo_Delete]
ON [dbo].[TB_LogInfo]
For Delete
AS
declare
@ID int,
@SourceID nvarchar(max),
@ModuleID nvarchar(max),
@TypeID nvarchar(max),
@KeyID nvarchar(max),
@DetailDescription nvarchar(max),
@CreateDate nvarchar(max),
@CreateBy nvarchar(max)
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
if EXISTS(SELECT 1 FROM deleted)
begin
select @ID=ID,
@SourceID=SourceID,
@ModuleID=ModuleID,
@TypeID=TypeID,
@KeyID=KeyID,
@DetailDescription=DetailDescription,
@CreateDate=CreateDate,
@CreateBy=CreateBy
from deleted
insert into TB_LogInfo_Bak(ID,SourceID,ModuleID,TypeID,KeyID,DetailDescription,CreateDate,CreateBy)
values(@ID,@SourceID,@ModuleID,@TypeID,@KeyID,@DetailDescription,@CreateDate,@CreateBy)
end
END
◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。