Stuck user in Role

  • Hi there

    I have a problem which i need to solve asap.

     

    I have a user stuck in the public role on a database where the login has been removed and i am unable to remove them from the public role , the problem is i need to recreate the user and cannot i get the error message "user or role "username" already exists in the current database"

     

    how would i ger around this?

     

    Thanks

  • You're using EM aren't you...

    Either:

    Create the login but DO NOT attempt to add to the db. Then look at sp_change_users_login to fix the association

    OR:

    Use sp_revokedbaccess 'user' in QA to remove the user, then recreate as normal

  • I ran the sp_revokedbaccess for the user on the database which removed the user from the public role and from the sysusers table but i still get the same error when i try give that user access to the db

  • Close your EM and re-open it. EM is caching data

  • when i create the user now i and try look at the properties in em i get the following error :

     

    error 21776:[SQL-DMO]The name 'username' was not found in the Users collection. If the name is a qualified name, use [] to seperate variouse parts of the name, and try again

  • What is the username you are trying?

  • Try disconnecting and reconnecting to the Server on EM

  • Does the same as "Close your EM and re-open it. EM is caching data" if you're not too familiar with SQL Server?

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

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