In my web application, I am writing a request to verify the user ID and password. If userid does not work, I write the request that it displays is incorrect if the password is incorrect and the password is incorrect. The query I'm writing just returns an int, but I want to return a table or row of data, can you give me a solution?
This is my request:
user table consists of username, email, mobile phone, country, etc.,
create procedure [dbo].[sp_users_login] (
@username varchar(30),
@password varchar(30),
@ret int output)
as
if exists (select username from users where username=@username)
if exists (select [password], username
from users
where [password]=@password
and username=@username)
set @ret =1
else
set @ret=2
else
set @ret=3
My request will only return int, but I also need user data. For example: user, emailid, etc. I want to get detailed information about a specific user - is this possible in this request?
source
share