Hi All,
I am trying to make login module where if the registered user forgets its password, an email will be sent to its valid email ID with a system generated password.
For the same i have created two stored procedures, one for validating the email , which if valid, send an email to the email address with the temporary password for the user. the 2nd SP, returns the username and calls another SP and generates a random password. This password is sent in an unencrypted form to the user's email and the encrypted password is updated in the database.
The stored procedures are :
1st one : create PROCEDURE [dbo].[Usp_UserForgotPassword]
(
@pEmail varchar(250)
)
as
Begin
Declare @vrowcount int
SELECT @vrowcount=COUNT(1)
FROM login
WHERE Email=@pEmail
if @vrowcount=0
begin
  ...
Go to the complete details ...