delete user of db in sql server

  • Hi

    i have a DB IN SQL SERVER . I Dettach it and take it to another pc

    and attach it on sql server of that pc.

    but in mydb-->security-->users there is a user of another sql server which is not here in this sql server.

    i wants to delete it. it is also db_owner.

    but i cant remove it.

    how can it do?

    Thanks

  • Hi,

    Please share the error you are getting while trying to delete the user.

    Are you getting error related to schema or something else.

    Regards

    Shafat Husain

    Regards,
    Shafat Husain
    🙂
    And Your Lord Never Forgets...!! (64:19 -- Quran)

  • If that login is the owner of a database, you won't be able to remove it. First change the owner of the database to another login, then try again.

    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
  • Replace "<your_db_name>" with the restored db name:

    ALTER AUTHORIZATION ON DATABASE::<your_db_name> TO sa

    USE <your_db_name>

    DROP USER <user_name>

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.

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

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