While dropping the server login getting error

  • Hi All,

    Am using SQL2008,

    I have created one login(xxxxxxx) and now i want to drop that login but i cant able to that.

    while i am trying to drop that am getting the Following error..

    Login 'xxxxxx' owns one or more database(s). Change the owner of the database(s) before dropping the login.

    PFA..

    Regards

    Jagadeesh..

    Regards
    Chowdary...

  • The message is pretty clear. The login is the owner of one or more databases. You need to change the owner of those databases to be able to drop the user.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • The Screenshot which you've attached is basically an Informational Message. It's not an error.... All it is saying is, you should manually drop respective Database users later, because dropping a login using SSMS by default doesn't drop the mapped DB users.

  • Hi All thank you for giving the Reply...

    Actually am having only one database ,In that the User is not there to drop at database level,If it is there so that i can drop that,If it is not there how can I?.

    And that Screenshot i have given just for reference only.

    Regards

    Jagadeesh......

    Regards
    Chowdary...

  • If you are still getting the same error message when dropping the login, Did you checked who the Database Owner is as Gail suggested?

  • Chowdary's (6/12/2014)


    Actually am having only one database ,In that the User is not there to drop at database level

    I said nothing about the login being a user in the database. The login is the database *owner*, not a user. You need to change the owner of the database to another login, then you can drop that login.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • For e.g.

    Use DBName

    go

    EXEC sp_changedbowner 'sa'

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

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