on sdphoneqqinfo33
instead of INSERT
as
declare @phone VARCHAR(11);
declare @qq VARCHAR(10);
declare @n1 VARCHAR(1);
DECLARE @n2 VARCHAR(1);
DECLARE @n3 VARCHAR(1);
DECLARE @n4 VARCHAR(60);
select @phone=phone,@qq=qq,@n1=n1,@n2=n2,@n3=n3,@n4=n4 from inserted;
--如果存在,数据未变,更新时间
if ((select count(*) from sdphoneqqinfo33 where phone=@phone and qq=@qq)>0)begin
UPDATE sdphoneqqinfo33 set updatetime=getdate() where phone=@phone;
end
--如果存在,数据变动,更新数据ÿ