In management studio you can see the owner under properties but it won't let you change it. My guess is there's some stored procedure to change it and you can't do it through the gui.
3 Answers
Surpisingly, it's called sp_changedbowner.
You can actually change it in SQL Server Management Studio under Database / Properties / Files
Comments
In addition to using SSMS GUI, you can also use ALTER AUTHORIZATION or alternately use sp_changedbowner statement.
ALTER AUTHORIZATION ON DATABASE::MyDatabaseName TO NewOwner; GO Please note sp_changedbowner is deprecated from SQL Server 2012.
3 Comments
mlhDev
I saw that method online (and your onliner worked, +1 for that). Any insight why there are two different ways?
user353gre3
ALTER AUTHORIZATION is a DCL in T-SQL that is used to alter authorization of database objects that have owners associated. sp_changedbowner is a Microsoft's implementation of the same function as a System Stored Procedure. In fact, sp_changedbowner is deprecated from SQL Server 2012, and using it is not a best practice anymore. Please refer Microsoft's documentation at msdn.microsoft.com/en-us/library/ms178630.aspx.noelicus
This should be the answer considering the deprecation!