none
Unable to change Database Owner

    Question

  •  

    Hi All,

     

    Can someone please advise.

     

    I am trying to change the database owner. I am logged in as sa.

    I am using the command sp_changedbowner 'username'

     

    I seem to get the following error message:

     

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

     

    I have created the user account. But am still getting the same error.

     

    Wednesday, October 31, 2007 11:39 AM

Answers

  •    The principal (login) who is going to be the new owner should not exist in as a user the database. What you actually need is the login name.

     

    SELECT name FROM sys.server_principals

     

      Most likely you are specifying a login name for the new user that is not a valid login name in your system.   For detailed information please consult BOL for this topic (http://msdn2.microsoft.com/en-us/library/ms178630.aspx), but if you have further questions we will be glad to help

     

      -Raul Garcia

      SDE/T

      SQL Server Engine

     

    Wednesday, October 31, 2007 6:27 PM

All replies

  • Is the login you have created a valid user in the database?

     

    EXEC sp_helpuser

     

    HTH!

    Wednesday, October 31, 2007 11:57 AM
  • yes. It is in the db_owner group name.

     

    Wednesday, October 31, 2007 12:10 PM
  • Can you provide the command you are using and the output for:

     

    select * from sys.database_principals

     

    Wednesday, October 31, 2007 2:10 PM
  •    The principal (login) who is going to be the new owner should not exist in as a user the database. What you actually need is the login name.

     

    SELECT name FROM sys.server_principals

     

      Most likely you are specifying a login name for the new user that is not a valid login name in your system.   For detailed information please consult BOL for this topic (http://msdn2.microsoft.com/en-us/library/ms178630.aspx), but if you have further questions we will be glad to help

     

      -Raul Garcia

      SDE/T

      SQL Server Engine

     

    Wednesday, October 31, 2007 6:27 PM