我有一个带有 uid、用户名和密码的表以及检查登录的过程
create procedure getlogin(@username varchar(50),@password varchar(20),@granted int output)
as
begin
if exists (select top 1 uid
from user_detail
where username = @username and password = @password)
set @granted=1
else
set @granted=-1
end
但我总是得到-1