Changing Owner NOT dbo_Owner

  • An administrator restored some SharePoint databases for me and did not use the service account I asked him to use and consequently his name is in the Owners field (Right Click DB in SSMS --> Properties--> General Tab --> Owner). When I tried to change this to the Service Account that is the actual DBO I get

    Msg 15110, Level 16, State 1, Line 1

    The proposed new database owner is already a user or aliased in the database.

    How can I alter my DB so that the Owner is the Service account and no the the admin doing the restore of the DB?

    This is in our test environment.

    Thank you!

    Even as a mother protects with her life
    Her child, her only child,
    So with a boundless heart
    Should one cherish all living beings;

  • Change it to 'sa'

     

    EXEC sp_changedbowner 'sa'

    Michael L John
    If you assassinate a DBA, would you pull a trigger?
    To properly post on a forum:
    http://www.sqlservercentral.com/articles/61537/

  • Or, remove the service account from the users in the database and then add the service account as the new owner:

    USE YourDatabase;
    GO

    DROP USER YourServiceAccount;
    GO
    EXEC sp_changedbowner 'YourServiceAccount';

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Thanks, but it can't be the SA account. It needs to be a specific service account.

    Even as a mother protects with her life
    Her child, her only child,
    So with a boundless heart
    Should one cherish all living beings;

  • i prefer the alter authorization command:

    ALTER AUTHORIZATION ON DATABASE::[WSS_Content]  to  [MyDomain\SharePointServiceAccount];

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply