SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[update_info]
On [dbo].[t_weaving_production_info]
After update As
BEGIN
Declare
@id varchar(10),
@stateValue nvarchar(10),
@mInsert varchar(200)
select @id = CAST(id AS varchar) from inserted;
--select @stateValue = stateValue from inserted;
if update(weightTime)
begin
Set @mInsert ='Insert into t_weaving_production_info_history Select * from t_weaving_production_info where id = ' + @id
Exec(@mInsert)
end
SET NOCOUNT ON;
END
SQL触发器如何判断当前UPDATE字段
于 2023-10-23 19:05:32 首次发布