sp_iqpassword procedure

Function

Changes a user’s password. The preferred way to create a user is by using the CREATE USER statement. See “CREATE USER statement,” in Chapter 1, “SQL Statements,” in Reference: Statements and Options.

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 authority required to set other users’ passwords.

Usage

caller_password Your password. When you are changing your own password, this is your old password. When the DBA is changing another user’s password, caller_password is the DBA’s 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. Do not specify user_name when changing your own password.

Description

Any user can change his or her own password using sp_iqpassword. The DBA can change the password of any existing user.

Examples

Example 1 Changes the password of the logged in user from irk103 to exP984:

sp_iqpassword 'irk103', 'exP984' 

Example 2 Changes the password of user joe from eprr45 to pdi032 only if the logged in user has DBA privileges or the user is joe himself:

call sp_iqpassword ('eprr45', 'pdi932', 'joe')