Re: Cannot change the database owner

From: Dan Guzman (guzmanda_at_nospam-online.sbcglobal.net)
Date: 10/25/05

  • Next message: Sue Hoegemeier: "Re: sql server sp_addlogin from vb.net and security !!!!"
    Date: Mon, 24 Oct 2005 19:07:28 -0500
    
    

    To add to Geoff's response, you might also get the error if the current
    database owner is not linked correctly. In that case, you can work around
    the problem by changing the database owner to another login and then to
    'sa':

    USE MyDatabase
    EXEC sp_addlogin 'TempOwner'
    EXEC sp_changedbowner 'TempOwner'
    EXEC sp_changedbowner 'sa'
    EXEC sp_droplogin 'TempOwner'

    -- 
    Hope this helps.
    Dan Guzman
    SQL Server MVP
    "Rich" <Rich@discussions.microsoft.com> wrote in message 
    news:AC045038-6DB4-4854-A927-32F03F984D38@microsoft.com...
    > Hello Group,
    >
    > I have restored a database to a server and want to change the owner from 
    > me
    > to the SA.  I have tried to use " Exec sp_changedbowner 'sa' " but get 
    > this
    > error:
    >
    > Server: Msg 15110, Level 16, State 1, Procedure sp_changedbowner, Line 46
    > The proposed new database owner is already a user in the database.
    >
    > I have done this at least hundred times without a problem, what is this
    > error saying about the USER?  I am trying to chang the owner...
    >
    > Rich 
    

  • Next message: Sue Hoegemeier: "Re: sql server sp_addlogin from vb.net and security !!!!"