Change Database Owner

, 2011-09-28

This is post is going to be very simple but it is something I come across ever so often and find myself having to look up the syntax most of the time.  I guess it is one of those things that if you don’t use it often enough you don’t commit it to memory.

So here is my story, I routinely come across database servers that when you go to look at the properties of the database you get that dreadful message about the “Property Owner is not available for Database ‘[db_name]‘.  This property may not exist for this object, or may not be retrievable due to insufficient access rights.”  It is a very simple fix if you can remember the stored procedure to execute.  All you have to do is assign the proper user as DBO.

The bigger question is how did this issue occur in the first place.  For those of you novice DBA’s you may or may not be aware that when you restore a database you become the owner of the database unless you change it.

So how to correct this.  Simple.  EXEC sp_changedbowner ‘SA’  You can substitute another account in place of SA if that is your companies practice.

Rate

Share

Share

Rate

Related content

Database Mirroring FAQ: Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup?

Question: Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup? This question was sent to me via email. My reply follows. Can a 2008 SQL instance be used as the witness for a 2005 database mirroring setup? Databases to be mirrored are currently running on 2005 SQL instances but will be upgraded to 2008 SQL in the near future.

2009-02-23

1,567 reads

Networking - Part 4

You may want to read Part 1 , Part 2 , and Part 3 before continuing. This time around I'd like to talk about social networking. We'll start with social networking. Facebook, MySpace, and Twitter are all good examples of using technology to let...

2009-02-17

1,530 reads

Speaking at Community Events - More Thoughts

Last week I posted Speaking at Community Events - Time to Raise the Bar?, a first cut at talking about to what degree we should require experience for speakers at events like SQLSaturday as well as when it might be appropriate to add additional focus/limitations on the presentations that are accepted. I've got a few more thoughts on the topic this week, and I look forward to your comments.

2009-02-13

360 reads