Description
Sets the specified user's password to the password input to the stored procedure.
Parameters
| Name |
Type |
Direction |
| @ApplicationName |
nvarchar |
Input |
| @UserName |
nvarchar |
Input |
| @NewPassword |
nvarchar |
Input |
| @PasswordSalt |
nvarchar |
Input |
| @CurrentTimeUtc |
datetime |
Input |
| @PasswordFormat |
int |
Input |
Definition
CREATE PROCEDURE dbo.aspnet_Membership_SetPassword
@ApplicationName nvarchar(256),
@UserName nvarchar(256),
@NewPassword nvarchar(128),
@PasswordSalt nvarchar(128),
@CurrentTimeUtc datetime,
@PasswordFormat int = 0
AS
BEGIN
DECLARE @UserId uniqueidentifier
SELECT @UserId = NULL
SELECT @UserId = u.UserId
FROM dbo.aspnet_Users u, dbo.aspnet_Applications a, dbo.aspnet_Membership m
WHERE LoweredUserName = LOWER(@UserName) AND
u.ApplicationId = a.ApplicationId AND
LOWER(@ApplicationName) = a.LoweredApplicationName AND
u.UserId = m.UserId
IF (@UserId IS NULL)
RETURN(1)
UPDATE dbo.aspnet_Membership
SET Password = @NewPassword, PasswordFormat = @PasswordFormat, PasswordSalt = @PasswordSalt,
LastPasswordChangedDate = @CurrentTimeUtc
WHERE @UserId = UserId
RETURN(0)
END
ASP.NET 2.0 Provider Database