sp_droplogin System Stored Procedure

Removes a SQL Server login ID by deleting the user's entry in master.dbo.syslogins.

Syntax

sp_droplogin login_id

where

login_id
Is the name of the user as listed in master.dbo.syslogins.

Remarks

The sp_droplogin procedure checks only the current database to see if the login ID to be dropped is a user there. You cannot drop a user's login ID if the user is an object owner or user in any database(s).

Example

This example drops the login ID Victoria from SQL Server.

sp_droplogin Victoria

Permission

Only the system administrator can use this procedure.

Tables Used

master.dbo.syslogins, sysusers

See Also

sp_addlogin sp_dropuser
sp_changedbowner sp_helpuser
sp_dropalias