Wednesday, January 30, 2013

Change Database Owner

Here is something I perform so rarely I can never remember how to do it.  If a databases is created and no owner is specified, it will make the current user the owner.  If this is not what you intended you can change the owner of the database with one of the following methods.

To change the database owner the old way:
exec sp_changedbowner [sa]
or the new way:
alter authorization on Database::<DBName>
to [sa]

I'm pretty sure the old way is deprecated and the new way is the preferred method.

Thursday, January 17, 2013

Blogging

Over the last year I have been trying to learn as many of the features of SQL Server, Sharepoint and a few other technologies as possible.  What I would end up doing was pick a topic and spend the evening or two and try to learn as much as possible about it.  In the case of replication I would setup the different types and see how it works.  I would see how things react to server failures, and how to recover.  Basically I wanted to try to test every possible situation I could possible come across.

Over time I found that like many things, if you don't write it down or record it, you forget it.  So many of the things I've learned I have forgotten. So earlier this year I read a blog about new years resolutions.  And the point of the blog was to learn something new every day and then write about it.  Well I was already kinda doing that, but I decided to start blogging.  

Hopefully what I enter here can be useful to someone else.  At the very least it will be a record of what I have learned and the results I found.