When user forgot the password or if password expiration policy of login set then we have to change password.
New password must not be null and at least 6 characters long.
Syntax to change Sybase login password:
sp_password caller_passwd, new_passwd [, loginame, @immediate]
Where
caller_passwd is system security officer password. If we are granted SSO role then only can change password.
new_passwd is the new password to be set for the login.
loginname is the login name to change the password.
Exmaple:
A System Security Officer whose password is “admin@123” has changed test password to “test@123”:
sp_password admin@123, test@123,test go
To lock and unlock Sybase login: When we want to disable a login or restrict access to Adaptive Server, then we lock login.
sp_locklogin [loginame, "{lock | unlock}"]
To lock login:
sp_locklogin test, 'lock' go
To unlock login:
sp_locklogin test, 'unlock' go
To know account status of login, we have to execute the command
sp_displaylogin login_name go