I am executing this code to create user in my database.
CREATE LOGIN john WITH PASSWORD = 'john123';
GO
USE mytestdb;
GO
CREATE USER [john] FOR LOGIN [john]
GO
ALTER USER [john] WITH DEFAULT_SCHEMA=[dbo]
GO
ALTER ROLE [db_datareader] ADD MEMBER [john]
GO
ALTER ROLE [db_datawriter] ADD MEMBER [john]
GO
GRANT EXECUTE ON SCHEMA::[dbo] TO [john]
GO
But I want to delete this my created user.
I tried to issue this command
USE myDB;
DROP USER john;
GO
but it throws this error.
The database principal owns a schema in the database, and cannot be dropped.