Drops a login account or list of accounts.
drop login login_name [, login_name_list] [ with override ]
specifies the name of login account to be dropped.
specifies a list of login accounts to be dropped.
drops the login even if there are non-available databases that cannot be checked for login references.
Drops the login accounts ravi and vinod.
drop login ravi, vinod
Executing drop login removes a user login from Adaptive Server, deleting the user’s entry from master.dbo.syslogins.
Adaptive Server reuses a dropped login’s server user ID, which compromises accountability. You can avoid dropping accounts entirely and, instead, use sp_locklogin to lock any accounts that will no longer be used.
If you need to drop logins, be sure to audit these events (using sp_audit) so that you have a record of them.
drop login deletes all resource limits associated with the dropped login.
drop login fails if the login to be dropped is a user in any database on the server. Use sp_dropuser to drop the user from a database. You cannot drop a user from a database if that user owns any objects in the database.
If the login to be dropped is a System Security Officer, drop login verifies that at least one other unlocked System Security Officer’s account exists. If not, drop login fails. Similarly, drop login ensures that there is always at least one unlocked system administrator account.
ANSI SQL – Compliance level: Transact-SQL extension.
The permission checks for drop login differ based on your granular permissions settings.
Granular permissions enabled |
With granular permissions enabled, you must be a user with manage any login privilege. |
Granular permissions disabled |
With granular permissions disabled, you must be a user with sso_role. |
Values in event and extrainfo columns of sysaudits are:
Event |
Audit option |
Command or access audited |
Information in extrainfo |
---|---|---|---|
139 |
login_admin |
drop login |
Keywords contain: loginname1[, ... [, loginnameN ]] |
Commands create login profile, create login, drop login profile, alter login, alter login profile,
Documents For more information about dropping login accounts, see the Security Administration Guide.
Functions lprofile_id, lprofile_name
System procedures sp_passwordpolicy, sp_displaylogin, sp_displayroles, sp_locklogin