Modifies the default database, default language, default role activation, or full name for an Adaptive Server login account. Changes the password expiration interval, the minimum password length, and the maximum number of failed logins allowed for a specified login.
sp_modifylogin {loginame | “all overrides”}, option, value
is the login account to be modified.
removes the system overrides that were set using the "passwd expiration", "min passwd length", or "max failed_logins" parameters. To remove all the login-specific values, specify:
sp_modifylogin "all overrides" "option" -1
specifies the name of the option to be changed. The options are:
Option |
Definition |
---|---|
defdb |
The “home” database to which the user is connected when he or she logs in. |
deflanguage |
The official name of the user’s default language. |
fullname |
The user’s full name. |
"add default role" |
The role or roles to be activated by default at login. |
"drop default role" |
The role or roles to be dropped from the list of roles activated by default at login. This option affects only user-defined roles, not system roles. |
"passwd expiration" |
The password expiration interval in days. It can be anyvalue between 0 and 32767, inclusive. |
"min passwd length" |
The minimum password length required for the specified login. It can be any value between 0 and 30, inclusive. 0 specifies that no password is required. The default is 6. |
"max failed_logins" |
The number of allowable failed login attempts for the specified login. It can be any value between 0 and 32767, inclusive. |
is the value of the option you specified for the option parameter. The value parameter is a character datatype; therefore, quotes are required for positive and negative numeric values.
Changes the default database for “sarah” to pubs2:
sp_modifylogin sarah, defdb, "pubs2"
Sets the default language for “claire” to French:
sp_modifylogin claire, deflanguage, "french"
Changes the full name of user “clemens” to “Samuel Clemens”:
sp_modifylogin clemens, fullname, "Samuel Clemens"
Adds the specialist role to the list of roles activated by default when user csmith logs in:
sp_modifylogin csmith, "add default role", specialist_role
Drops the intern role from the list of roles activated by default when user “hpillai” logs in:
sp_modifylogin hpillai, "drop default role", intern_role
Changes the maximum number of failed login attempts for the login “joe” to 40:
sp_modifylogin "joe", "max failed_logins", "40"
Changes the overrides for maximum failed login attempts of all logins to 3:
sp_modifylogin "all overrides", "max failed_logins", "3"
Removes the overrides for maximum failed logins option for all logins:
sp_modifylogin "all overrides", "max failed_logins", "-1"
Set a default database, language, or full name either with sp_modifylogin or with sp_addlogin when first adding the user’s login to Adaptive Server.
If you do not specify a default database, the user’s default is master.
If you do not specify a language, the user’s default language is set to the server’s default language.
If you do not specify a full name, that column in syslogins remains blank.
If there are any login triggers associated with
the login in question, they are listed after the Auto
Login Script
line. For more information, see “Row-level
access control” on page 406 of the System
Administration Guide.
For more information about password expiration interval, minimum password length, and maximum number of failed logins, see “User-Defined Login Security” in the System Administration Guide.
After sp_modifylogin is executed to change the user’s default database, the user is connected to the new defdb the next time he or she logs in. However, the user cannot access the database until the Database Owner gives the user access through sp_adduser or sp_addalias, or unless there is a “guest” user in the database’s sysusers table. If the user does not have access to the database by any of these means, she or he is connected to master and an error message appears.
If a user’s default database is dropped, or if the user is dropped from the database, the user is connected to master on his or her next login, and an error message appears.
If a user’s default language is dropped from the server, the server-wide default language is used as the initial language setting, and a message appears.
Use sp_modifylogin to set a role to be activated by default at login or to drop a role from those activated by default at login.
Only a System Administrator can execute sp_modifylogin to change the default database, default language, or full name of another user. Only a System Security Officer can execute sp_modifylogin to activate another user’s roles by default at login. Any user can execute sp_modifylogin to change his or her own login account.
System procedures sp_activeroles, sp_addalias, sp_addlogin, sp_adduser, sp_displaylogin, sp_displayroles, sp_helprotect