can not drop user from database

Problem :-
 
I can not delete user from a database in sql2005 beta 3.
the message errror is :

TITLE: SQL Server Management Studio
—————————————-

Drop failed for User ‘Amministratore’.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft SQL Server&ProdVer=9.00.0981.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Drop+User&LinkId=20476

—————————————-
ADDITIONAL INFORMATION:

An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

—————————————-

The database principal owns a schema and cannot be dropped. (Microsoft SQL Server, Error: 15138)

 

 

 

Solution:-

1) Expand Schemas(should be like a folder under <yourdatabase> -> Security) .
2) Script the the unwanted "userSchema" save it and and then Delete the schema.
3) Then, go back to the User,script the user and then delete the user.

4) Associate the schema back to the user by running the script.

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Random Thoughts

The World as I see it

Simple Programmer

Making The Complex Simple

Ionic Solutions

Random thoughts on software construction, design patterns and optimization.

Long (Way) Off

A tragic's view from the cricket hinterlands

%d bloggers like this: