set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[UserLogin]
@User_ID char(40) ,
@Password char(40),
@OptDescription char(50) output
AS
select User_ID from tbUser where User_ID = @User_ID
if (@@RowCount<1)
begin
set @OptDescription ='noUser'
set @User_ID=0
end
else
begin
SELECT User_ID FROM tbUser WHERE (User_ID = @User_ID) AND (PSW = @Password )
if (@@RowCount<1)
begin
set @OptDescription ='UserError'
set @User_ID=0
end
else
begin
set @OptDescription='access'
end
end
RETURN
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[UserLogin]
@User_ID char(40) ,
@Password char(40),
@OptDescription char(50) output
AS
select User_ID from tbUser where User_ID = @User_ID
if (@@RowCount<1)
begin
set @OptDescription ='noUser'
set @User_ID=0
end
else
begin
SELECT User_ID FROM tbUser WHERE (User_ID = @User_ID) AND (PSW = @Password )
if (@@RowCount<1)
begin
set @OptDescription ='UserError'
set @User_ID=0
end
else
begin
set @OptDescription='access'
end
end
RETURN
set QUOTED_IDENTIFIER ON
go
ALTER PROCEDURE [dbo].[UserLogin]
@User_ID char(40) ,
@Password char(40),
@OptDescription char(50) output
AS
if not exists(select User_ID from tbUser where User_ID = @User_ID )
begin
set @OptDescription ='noUser'
set @User_ID=0
end
else
begin
if not exists(SELECT User_ID FROM tbUser WHERE (User_ID = @User_ID) AND (PSW = @Password )
)
begin
set @OptDescription ='UserError'
set @User_ID=0
end
else
begin
set @OptDescription='access'
end
end
RETURN