sp_iqpassword Procedure

Changes a user’s password.

Syntax1

call sp_iqpassword (‘caller_password’, ‘new_password’ [, ‘user_name’])

Syntax2

sp_iqpasswordcaller_password’, ‘new_password’ [, ‘user_ name’]

Permissions

None to set your own password; DBA or PERMS ADMIN authority required to set other users’ passwords.

Usage

Parameters

Parameter

Description

caller_password

Your password. When you are changing your own password, this is your old password. When the DBA or PERMS ADMIN is changing another user’s password, caller_password is the DBA or PERMS ADMIN password.

new_password

New password for the user, or for loginname.

user_name

Login name of the user whose password is being changed by the DBA or PERMS ADMIN. Do not specify user_name when changing your own password.

Description

A user password is an identifier. Any user can change his or her own password using sp_iqpassword. The DBA or PERMS ADMIN authority can change the password of any existing user.

The preferred way to create a user is by using the CREATE USER statement.

Identifiers have a maximum length of 128 bytes. They must be enclosed in double quotes or square brackets if any of these conditions are true:

  • The identifier contains spaces.

  • The first character of the identifier is not an alphabetic character (as defined below).

  • The identifier contains a reserved word.

  • The identifier contains characters other than alphabetic characters and digits.

    Alphabetic characters include the alphabet, as well as the underscore character (_), at sign (@), number sign (#), and dollar sign ($). The database collation sequence dictates which characters are considered alphabetic or digit characters.

Examples

Changes the password of the logged in user from irk103 to exP984:
sp_iqpassword 'irk103', 'exP984' 
Changes the password of user joe from eprr45 to pdi032 only if the logged in user has DBA or PERMS ADMIN privileges or the user is joe himself:
call sp_iqpassword ('eprr45', 'pdi932', 'joe')
Related reference
sp_expireallpasswords Procedure
sp_iqaddlogin Procedure
sp_iqcopyloginpolicy Procedure
sp_iqmodifyadmin Procedure
sp_iqmodifylogin Procedure