Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 15023: User or role already exists.... 2

Status
Not open for further replies.

JoseC

Programmer
Dec 11, 2001
18
0
0
SQL 7.0

I have added a user 'John' into my database via EM GUI (Databases -> Security -> Logins -> New Login).

When I try to add that user to the specific database (Databases -> DBname -> Users -> New Database Users) I get "Error 15023: User or role 'John' already exists in the current database"
Yet there is no 'John' user visible in the Users window, but there is an entry of 'John' in the SysUsers table.

How do I delete that entry in SysUsers table?? or What should I do to add my user??
 

Use the system stored procedure - sp_change_users_login - to correct problems with the users and logins. If that fails, you can update sysusers directly after setting the server option "allow updates" ON.

USE master

EXEC sp_configure 'Allow Updates', '1'
Reconfigure

Use mydatabase

delete sysusers where name='john'

USE master

EXEC sp_configure 'Allow Updates', '0'
Reconfigure

You can also set the "Allow Updates" option from Enterprise Manager, if you prefer. Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Thank you so much, I still got some errors during execution but it did work!!

I've got a couple of more of USERS to delete, thanks!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top