How do I change dbowner to 'dbo'

  • I have created several databases in an instance in SQLServer 2008. I want to change the dbowner to 'dbo' instead of myself. How do I do it? What command should I use to perform this change?

    I have tried run this command: EXEC sp_changedbowner 'dbo' and I got the following error message:

    Msg 15151, Level 16, State 1, Line 1

    Cannot find the principal 'dbo', because it does not exist or you do not have permission.

    Please help me out on this.

  • As "dbo" is a database user and the owner of a database must be a login, you cannot specify "dbo". I typically use the "sa" login as the owner.

    EXEC sp_changedbowner 'sa'

    SQL = Scarcely Qualifies as a Language

  • Hi

    Only members of the sysadmin fixed server role can execute sp_changedbowner.

    To display a list of the valid login values, execute the sp_helplogins stored procedure.

Viewing 3 posts - 1 through 3 (of 3 total)

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