Who owns the DB?

If the DB owners on your databases are people who have left your company¬† or accounts that no longer exist or worse still, accounts that do exist but shouldn’t then this is very bad.

These owner accounts can do anything to your database including drop it. They are like mini sa users for that DB. Change the owner immediately.

You could do this on all DBs with the following command. This will show an error for the system DBs but you can ignore it.

Its a bit drastic so you might want to consider doing it one DB at a time.

EXEC sp_MSForEachDB ‘Use [?]; ALTER AUTHORIZATION ON DATABASE::[?] to sa;’

 

If you are using the wonderfull 2008 R2 version like me then you can see these in the object explorer details window. I don’t know from what version the object explorer started to show quite so much detail but its fantastic in the 2008 version. Right click the heading at the top to choose more columns like you would in windows explorer.

 

Advertisements

About davidbridge

I am a contractor for David Bridge Technology Limited specialising in database design and Web development using Microsoft technologies such as c#, MVC .net and SQL Server (full stack)
This entry was posted in SQL Stuff, Uncategorized and tagged , , . Bookmark the permalink.

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