楼主要好好学习一下SQL基本知识了:Create Proc Pr_AddRole @Account varchar(50) as if not exists(select top 1 account_id from 表 where account_id=@Account) begin insert into 表(字段1,字段2.......) values ('','',......) end
if ((select count(*) from table)=0) begin insert into 表(字段1,字段2.......) values ('','',......) end
是不是首先该学习 SQL 呢?
----我不知道了.
@Account varchar(50)
as if not exists(select top 1 account_id from 表 where account_id=@Account)
begin
insert into 表(字段1,字段2.......)
values ('','',......)
end
begin
insert into 表(字段1,字段2.......)
values ('','',......)
end