34,837
社区成员




declare @d varchar(10)
?
if exists(SELECT 1 form t where a=1 AND b=2)
update t ...
else
insert into t ...
declare @d varchar(10)
select @d=d from t where a=1 and b=2
if @d is not null
update t
else
insert into t
if exists(select 1 from t where a=1 and b=2)
update t
else
insert into t..