nanasaheb kirdat

nanasaheb kirdat

  • NA
  • 123
  • 1.6k

how to create stored procedure phpmyadmin

Jun 19 2020 12:58 AM
I have stored procedure of sql server in this stored procedure using how to create stored procedure in phpmyadmin.? 
 
ALTER PROCEDURE [dbo].[proc_SignIn] 
(
@UserName varchar(100)=null,
@Password varchar(300)=null
)
 
BEGIN
DECLARE @flag int=0;
DECLARE @Count int =0;
DECLARE @IsActive int=0;
DECLARE @IsApprove int=0;
SET @Count=(SELECT COUNT(EmailID) from tbl_UserDetails where UserName=@UserName AND [Password]=@Password)
if(@Count=1)
BEGIN
SET @IsActive=(SELECT COUNT(EmailID) from tbl_UserDetails WHERE UserName=@UserName AND [Password]=@Password AND IsDelete=0)
if(@IsActive=1)
BEGIN
SET @IsApprove=(SELECT COUNT(EmailID) from tbl_UserDetails WHERE UserName=@UserName AND [Password]=@Password AND IsApprove=1)
IF(@IsApprove=1)
BEGIN
SET @flag=1;
END
ELSE
BEGIN
SET @flag=-3;--Approve
END
END
ELSE
BEGIN
SET @flag=-2; --IsActive
END
END
ELSE
BEGIN
SET @flag=-1; --Password or UserName Incorrect
END
select @flag as result
END
 

Answers (1)