日期:2014-05-17 浏览次数:20580 次
ALTER procedure [dbo].[Pro_1]
@A varchar(50),
@B varchar(50),
@C varchar(100),
@Remark1 varchar(50),
@Remark2 varchar(50)
as
begin
insert into Contact([A],[B],[C],[Remark1],[Remark2])
Values(@A,@B,@C,@Remark1,@Remark2)
end
ALTER procedure [dbo].[Pro_1]
@A varchar(50),
@B varchar(50),
@C varchar(100),
@Remark1 varchar(50),
@Remark2 varchar(50)
as
begin
if exists(select 1 from Contact where [A]=@a)
begin
return 0--已存在
end
else
begin
insert into Contact([A],[B],[C],[Remark1],[Remark2])
Values(@A,@B,@C,@Remark1,@Remark2)
return 1--表示成功
end
end
ALTER procedure [dbo].[Pro_1]
@A varchar(50),
@B varchar(50),
@C varchar(100),
@Remark1 varchar(50),
@Remark2 varchar(50)
as
begin
if not exists (select 1 from contact where a=@a)
begin
insert into Contact([A],[B],[C],[Remark1],[Remark2])
Values(@A,@B,@C,@Remark1,@Remark2)
end
end