Drop User from SQL Server Database?

Is this what you are trying to do??

IF  EXISTS (SELECT * FROM sys.database_principals WHERE name = N'username')
DROP USER [username]

If you are using SQL Server Management Studio you can browse to the user and right-click selecting delete.


The accepted answer is working good enough. Additionally that is good to know SQL Server added IF EXIST to some DROP commands from version 2016 (13.x) including 'DROP USER' command.

IF EXISTS

Applies to: SQL Server ( SQL Server 2016 (13.x) through current version, SQL Database).

Conditionally drops the user only if it already exists.

So you could just delete user as below:

-- Syntax for SQL Server and Azure SQL Database  
DROP USER IF EXISTS user_name  

See the full description in this link: DROP USER (Transact-SQL)

Hope this help.