楼主定义触发器就可以搞定了,不用那么麻烦:
create trigger tri_test
on A
before update
--注意:关键是这里的before ,如果没有,那原始数据就不会保存到变量中去
as
declare @name varchar,@no varchar,@id int,@shu_liang int
begin
select @name = name from deleted
select @bian_hao = bian_hao from deleted
select @id= id from deleted
select @shu_liang = shu_liang from deleted
if (@name<> (select name from inserted) and @bian_hao<> (select bian_hao from inserted))
begin
insert into 表B values(@id,@name,@bian_hao,@shu_liang)
end
end