sp_iqlocklogin procedure

Function

Locks an IQ user account so that the user cannot log in.

Syntax1

call sp_iqlocklogin ( ‘login-name’, ‘[ lock | unlock ]’ )

Syntax2

sp_iqlockloginlogin-name’, ‘[ lock | unlock ]’ 

Syntax3

sp_iqlocklogin login-name, ‘[ lock | unlock ]’ 

Permissions

DBA authority required.

Usage

login-name Name of the account to be locked or unlocked.

See also

“sp_iqmodifyadmin procedure”

Description

When Sybase IQ User Administration is enabled, the DBA uses sp_iqlocklogin to prevent or enable a specified user’s ability to log in to the database.

You cannot lock yourself or the DBA account out of the database. Connected users can be locked, but they remain connected. A locked account can be specified as a database owner, and can own objects in any database.

Errors

The following errors may occur. Causes are listed after each error.

Permission denied: You do not have permission to execute the procedure sp_iqlocklogin.

Cause: A user without DBA role tried to execute sp_iqlocklogin.

RAISERROR executed: You cannot lock yourself out.

Cause: User tries to lock him or herself out.

RAISERROR executed: "The user DBA cannot be locked."

Cause: User tried to lock the DBA user.

RAISERROR executed: "Invalid option <what the user entered> was specified.” "

Cause: User typed in invalid input.

Examples

The following examples lock out the user rose.

sp_iqlocklogin 'rose', 'lock'
call sp_iqlocklogin ('rose', 'lock')

The following example unlocks the account of the user rose.

sp_iqlocklogin rose, 'unlock'