Changing the DB owner to dbo.

  • Hello,

    I came across an article on this site a while ago, which explained that its a good idea to change the owner of your databases objects to 'dbo', so I gave it a try and got the following error...

    cannot find the principal 'dbo' because it does not exist or you do not have permission

    So did a google, which gave similar messages for different situations, but not for a straightforward database owner change, I wondered if anyone could point me in the right direction?

    Thank you,

    D.

  • Check your permissions.

    Check any logins is with username as dbo

  • Hello,

    No there is no login as dbo, I should have checked this beforehand. Do I create one the same way as any other user and issue it sysadmin privs?

    Regards,

    D.

  • First let me know who created the database

  • Thanks for getting back, currently its the local admin account.

  • then change the default schema to dbo

  • The database's owner should actually be the SA account not dbo. To change the database owner use the following statement:

    USE <DatabaseName>

    exec sp_changedbowner @loginame = 'sa'

    GO

Viewing 7 posts - 1 through 6 (of 6 total)

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