27,579
社区成员
发帖
与我相关
我的任务
分享
update BuyApply
set Apply1='请问',ApplyUserID1='1',ApplyUser1='5',
ApplyMobile1='138',
ApplyTime1=getdate(),isApply=1
where ApplyID='16'
ALTER TRIGGER [dbo].[BackBuyApply]
ON [dbo].[BuyApply]
AFTER DELETE,UPDATE
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for trigger here
insert into [This_back].[dbo].[BuyApply]
select getdate() as backtime,*
from deleted
END
UPDATE [This].[dbo].[BuyApply]
SET [ApplyDeptID] =1
,[ApplyDeptName] =1
,[Apply1] = 1
,[ApplyUserID1] = 1
,[ApplyUser1] = 1
,[ApplyMobile1] = 1
,[ApplyTime1] =1
,[isApply] = 1
,[Apply2] = 1
,[ApplyUserID2] =1
,[ApplyUser2] = 1
,[ApplyMobile2] = 1
,[ApplyTime2] = 1
,[Apply3] = 1
,[ApplyUserID3] = 1
,[ApplyUser3] = 1
,[ApplyMobile3] = 1
,[ApplyTime3] = 1
,[Apply4] = 1
,[ApplyUserID4] = 1
,[ApplyUser4] =1
,[ApplyMobile4] = 1
,[ApplyTime4] = 1
,[Apply5] = 1
,[ApplyUserID5] = 1
,[ApplyUser5] = 1
,[ApplyMobile5] = 1
,[ApplyTime5] = 1
,[Apply6] = 1
,[ApplyUserID6] =1
,[ApplyUser6] = 1
,[ApplyMobile6] = 1
,[ApplyTime6] = 1
,[Apply7] = 1
,[ApplyUserID7] = 1
,[ApplyUser7] = 1
,[ApplyMobile7] = 1
,[ApplyTime7] = 1
,[isApply2] = 1
,[isApply3] = 1
,[isApply4] = 1
,[isApply5] = 1
,[isApply6] = 1
,[isApply7] = 1
WHERE ApplyID='16'
GO
--老老实实列出所有的列名,有那么困难吗?
INSERT INTO [This_back].[dbo].[BuyApply](字段1,字段2,字段3……)
select getdate() as 字段1,字段2,字段3……
from DELETED
insert into [This_back].[dbo].[BuyApply](字段名.....)
select getdate() as backtime,*
from deleted