ASP .NET stores its passwords in SQL tables in encrypted format. Sometimes we need to reset this password for QA and testing purposes. To do this, we need to change the Password FORMAT and Password SALT which are used to encrypt the password. The script below will reset the password for username sanjay to the value password.
update aspnet_Membership
set Password = 'password', PasswordFormat = 0, PasswordSalt = ''
from aspnet_Membership m inner join aspnet_Users u on m.ApplicationId = u.ApplicationId
and m.UserId = u.UserId
and u.UserName = 'admin' |