------解决方案-------------------- create proc laowan688 @admin nvarchar(20), @mess int as set nocount on if (select admin from table admin=@admin<>'')and(select mess from table mess=@mess<>'' ) begin return 1 end else begin return 0 end
create proc wsp
@val varchar(500)
as
declare @v varchar(500)
--判断帐号表中是否存在该用户
if exists(select 1 from 帐号表 where 用户名字段=left(@val,charindex(',',@val)-1))
begin
set @v=replace(substring(@val,charindex(',',@val)+1,len(@val)),',','.')
if exists(select 1 from 帐号表 where 用户名字段=left(@val,charindex(',',@val)-1) and 密码字段=PARSENAME(@v,4))
begin
insert into datas (field1,field2,field3) select PARSENAME(@v,3),PARSENAME(@v,2),PARSENAME(@v,1)
raiserror('成功',16,1)
end
else
raiserror('密码错误',16,1)
end
else
raiserror('该用户名不存在',16,1)
------解决方案--------------------