How do i drop user and add him again ?

  • Here is the situation:

    1. We restored a sqlsever database to a new server using a backup of production.

    2. Logged in using windows authentication.

    3. We had a user by the name NGSQLDB. I accidently gave him db_owner

    rights.

    4. Now I am stuck because I can not delete him.

    5. I am able to login to the database using my windows authentication account ( actually it is the administrator account in the new server )

    Help me here...

    How do I

    1.) Delete the user NGSQLDB ? ( don't tell me to use the GUI because ot failed and given an error message ).

    Please help...

  • 1.Change the owner of database.

    2.Look schema owned by the user and change them.

    3.Drop user

    I think it's work. But if you paste the error message could help more....

  • Pouliot Philippe (2/21/2011)


    1.Change the owner of database.

    2.Look schema owned by the user and change them.

    3.Drop user

    I think it's work. But if you paste the error message could help more....

    Some help please...

    How do you change the owner ? A sql command ? or guide me on the GUI please ?

    ( By the way we use SQL 2005 )

  • You should be able to remove the db_owner role from the user. Is this just a "change permissions" thing?

    Does this user own the database? You can use T-SQL to change that: http://msdn.microsoft.com/en-us/library/ms178630%28v=SQL.90%29.aspx

  • Steve Jones - SSC Editor (2/21/2011)


    You should be able to remove the db_owner role from the user. Is this just a "change permissions" thing?

    Does this user own the database? You can use T-SQL to change that: http://msdn.microsoft.com/en-us/library/ms178630%28v=SQL.90%29.aspx

    Thanks

    Well Done!

    It worked!

    Case Closed!

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

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