sp_dropuser System Stored Procedure

Removes a user from the current database by deleting the entry from the current database's sysusers table.

Syntax

sp_dropuser username

where

username
Is the user to drop.

Remarks

The owner of a database cannot be dropped. If other users are aliased to the user being dropped, their aliases are dropped and they can no longer access the database.

Example

This example drops the user Albert from the current database. He will no longer be able to use the database.

sp_dropuser Albert

Permission

Execute permission defaults to the database owner.

Tables Used

sysalternates, sysobjects, sysprotects, systypes, sysusers

See Also

GRANT sp_adduser
REVOKE sp_droplogin
sp_addalias USE