1 Version 4.0 -- 1/15/89 sp_password
______________________________________________________________________
NAME: sp_password
FUNCTION:
Adds or changes a password for a SQL Server login.
SYNTAX:
sp_password old, new [, loginame]
EXAMPLES:
1) sp_password null, ok, victoria
The System Administrator has changed victoria's password from
sp_password Version 4.0 -- 1/15/89 2
______________________________________________________________________
the default (NULL) to ok. Notice that NULL is not enclosed
in quotes.
2) sp_password ok, mediumhot
Victoria has changed her password from ok to mediumhot.
PARAMETERS:
old - is the user's old password, which is listed in
master.dbo.syslogins. In the usual installation, only the
System Administrator has SELECT permission on this field.
The default password for all users is NULL.
The System Administrator can give NULL for this parameter no
matter what the user's old password. However, if the System
Administrator gives any value besides NULL, SQL Server checks
it against master.dbo.syslogins and rejects it if it is
3 Version 4.0 -- 1/15/89 sp_password
______________________________________________________________________
wrong.
new - is the user's new password.
loginame - may only be used by the System Administrator to
change any user's password.
COMMENTS:
o Any user can change his or her password with sp_password.
o Only the System Administrator can use the loginame parameter
and change someone else's password.
o The old parameter is checked against the existing password for
the user loginame (unless the user executing the procedure is
the System Administrator and the old parameter is NULL), and
must match for the password to be changed. Passwords are
listed in master.dbo.syslogins.password. As permissions are
set up on SQL Server distribution media, only the System
Administrator has SELECT permission on this field.
sp_password Version 4.0 -- 1/15/89 4
______________________________________________________________________
o To give the NULL password in response to the Password: prompt,
press ENTER. To give the NULL password with isql and the -P
flag, use isql -P.
o If front-end programs require the same password on remote
servers and the local server, a user must change the password
on all the remote servers before changing the local password.
sp_password should be executed as a remote procedure call on
each remote server.
MESSAGES:
The password was successfully changed. The new password will be
required the next time the user logs in to SQL Server.
Any user can change his or her own password, but only the System
Administrator can change another user's password. You aren't
the System Administrator.
The name supplied for the loginame parameter does not exist on
5 Version 4.0 -- 1/15/89 sp_password
______________________________________________________________________
SQL Server.
The password supplied as the old parameter is not the current
password.
PERMISSIONS:
Execute permission to public for own password only. Execute per-
mission to System Administrator for any user's password.
TABLES USED:
master.dbo.syslogins
SEE ALSO:
sp_addlogin, sp_adduser, sp_defaultdb