locked
Can't change db owner RRS feed

  • Question

  • Hello!

    SQL Server 2012R2 Express, I need to change db owner from Domain1\User1 to Domain2\User1. Both SQL login Domain2\User1 and db user Domain2\User1 exist; db user Domain2\User1 is mapped to SQL login Domain2\User1.

    When I try to change db owner from  Domain1\User1 to Domain2\User1 I get the error:

    This article does not imply any restrictions on users that can be made db owners:

    https://technet.microsoft.com/en-us/library/ms190909%28v=sql.105%29.aspx

    "In SQL Server, the owner of the current database can be changed. Any user, a SQL Server login or Microsoft Windows user, who has access to connect to SQL Server can become the owner of a database."

    Why can't I make the owner of a db an SQL login that have a mapped user in that db?

    Thank you in advance,

    Michael

    Tuesday, July 21, 2015 11:10 AM

Answers

  • Because the owner of the database always maps to dbo, and a login cannot map to two different users in the database.

    You first need to drop the user Domain2\User1 from the database before you can proceed.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Marked as answer by MF47 Tuesday, July 21, 2015 12:55 PM
    Tuesday, July 21, 2015 11:33 AM

All replies

  • Because the owner of the database always maps to dbo, and a login cannot map to two different users in the database.

    You first need to drop the user Domain2\User1 from the database before you can proceed.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Marked as answer by MF47 Tuesday, July 21, 2015 12:55 PM
    Tuesday, July 21, 2015 11:33 AM
  • Erland, thank you very much for the help!

    Regards,

    Michael

    Tuesday, July 21, 2015 12:55 PM