CREATE proc CheckLogin @UserName varchar(20) ,@UserPassword varchar(40), @Msg varchar(100) output, @ResultID bit outputasbegin declare @ResultCount int /*返回行数*/ declare @StoredPassWord varchar(40) /*传递查询得到的密码*/ select @ResultCount = count(*) from S_UserInfo where UName = @UserName if @ResultCount = 0 begin set @Msg = '用户名不存在,请重新输入!' set @ResultID = 0 end else begin select @StoredPassWord = UPassword from S_UserInfo where UName = @UserName if @StoredPassWord = @UserPassword begin set @Msg = '登录成功!' set @ResultID = 1 end else begin set @Msg = '密码或用户名错误' set @ResultID = 0 end endend
CREATE proc CheckLogin @UserName varchar(20) ,@UserPassword varchar(40), @Msg varchar(100) output, @ResultID bit outputasbegin declare @ResultCount int /*返回行数*/ declare @StoredPassWord varchar(40) /*传递查询得到的密码*/ select @ResultCount = count(*) from 表所有者.S_UserInfo where UName = @UserName if @ResultCount = 0 begin set @Msg = '用户名不存在,请重新输入!' set @ResultID = 0 end else begin select @StoredPassWord = UPassword from 表所有者.S_UserInfo where UName = @UserName if @StoredPassWord = @UserPassword begin set @Msg = '登录成功!' set @ResultID = 1 end else begin set @Msg = '密码或用户名错误' set @ResultID = 0 end endend ------解决方案-------------------- 你应该是要去修改表所有者为dbo ------解决方案--------------------