if exists(select 1 from Table1 where A=0)
begin
update Table1
set B=B+1
from Table1
where A=0
end
else
begin
insert into Table1(A,B)
select 0,0
end
begin
update Table1
set B=B+1
from Table1
where A=0
end
else
begin
insert into Table1(A,B)
select 0,0
end
update table1 set b=b+1 where a=0
else
insert table1 values(0,0)
update [Table1] set B=B+1 where A=0
else
insert [Table1](A,B) select 0,0
insert table1 select 0,1create proc p1
as
if (select count(1) from table1 where a=0)>0
update table1 set b=b+1 where a=0
else
insert table1 values(0,0)
exec p1
select * from table1---A=0的记录的纪录不存在时,执行存储过程后的结果delete from table1exec p1
select * from table1
drop table table1
drop proc p1
if exists(select * from table1 where a=0)
begin
update table1 set b=b+1
end
else
begin
insert table1(a,b) values(0,0)
end
http://community.csdn.net/Expert/TopicView3.asp?id=5488358