Thursday, March 22, 2012

The database principal owns a schema in the database, and cannot be dropped

While restoring a database backup file in my hosting I was prompted with some error message regarding existing user in the database. So I decided to delete those users. But while trying to delete the users from my local sql sever management studio, error occurred.
The database principal owns a schema in the database, and cannot be dropped.
I tried out browsing the property of the user and removing the assigned scheme from the lists. It was somehow unsucessful. So I decided to go search for the solution and stumbled at doing it the most powerful way - through command.
Here goes the solution - Revoke the database schema assigned to the user and assign it back to the default db object.
ALTER AUTHORIZATION ON SCHEMA :: my_user_name to db_owner
 If you want to assign the schema  to another user, here is how you accomplish it.
 ALTER AUTHORIZATION ON SCHEMA :: my_schema_name to my_user_name
Cheers!
kick it on DotNetKicks.com

Monday, March 5, 2012

Invitation to connect on LinkedIn

 
LinkedIn
 
 
 
sangam uprety
 
From sangam uprety
 
Executive Director at Time Infotech
Nepal
 
 
 

I'd like to add you to my professional network on LinkedIn.

- sangam

 
 
 
 
 
 
You are receiving Invitation to Connect emails. Unsubscribe
© 2012, LinkedIn Corporation. 2029 Stierlin Ct. Mountain View, CA 94043, USA
 

Popular Posts

Recent Articles