Description:
Change the password of the login account.
Syntax:
sp_password
[[
@old =] 'old_password',]
[
@new =] 'new_password'
[, [
@loginame =] 'login']
@old |
Original password of the login account (NULL means without a password, the default value is NULL). |
@new |
New password of the login account (NULL means without a password). |
@loginame |
Name of the login account whose password will be changed (NULL means to change the password of the logged in account; the default value is NULL). |
Example1:
Change the password for the account 'pm_reader' from the old value 'reader' to the new value 'abcdef'.
EXEC sp_password 'reader', 'abcdef', 'pm_reader'
Example2:
Change the password for the logged in account from the old value 'reader' to the empty value (without a password).
EXEC sp_password 'reader', NULL