Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 User won't go away

Author  Topic 

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-10-23 : 00:45:15
Hi my darlings...

I've just been helping one of our admin guys here with a problem...

SQL Server 7.0

There is a user in the sysusers table which won't go away. When you try to add a login group that contains that user you get errors. When you try to add that user in explicitly, you get "user already exists" etc.

The user does not show up in the Users folder in EM. (no matter how many times you refresh)

All sessions are dead, and the server has just been restarted. (the network is disconnected too)

Obviously I can't do
delete sysusers where uid=120
but gee I'd like to...

Any ideas?



--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"

chadmat
The Chadinator

1974 Posts

Posted - 2002-10-23 : 01:13:40
if you do sp_changeuserslogin 'report' does the user show up?

If so, create a login for it and remap it using sp_changeuserslogin.


What happens when you run sp_dropuser?

-Chad

Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-10-23 : 01:21:32
No luck I'm afraid Chad,

quote:

if you do sp_changeuserslogin 'report' does the user show up?


no
quote:

What happens when you run sp_dropuser?


It responds that the user does not exist in the current database (master or the DB I'm interested in)

any more ideas?


Edited by - rrb on 10/23/2002 23:10:46
Go to Top of Page

Margaret
Starting Member

4 Posts

Posted - 2002-10-25 : 09:03:01
I have had issue's with the EM(GUI) not being up to date in the past. Did you try dropping the user via sp_droplogin or sp_dropuser.

Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-10-27 : 17:22:47
Thanks Margaret,

you must have missed the bit where I said
quote:

No luck I'm afraid Chad,


quote:
--------------------------------------------------------------------------------

if you do sp_changeuserslogin 'report' does the user show up?

--------------------------------------------------------------------------------


no

quote:
--------------------------------------------------------------------------------

What happens when you run sp_dropuser?

--------------------------------------------------------------------------------


It responds that the user does not exist in the current database (master or the DB I'm interested in)


Can anyone else help?

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

royv
Constraint Violating Yak Guru

455 Posts

Posted - 2002-10-28 : 09:59:48
I know this is not what you want to hear, but I would at this point backup my database and then recreate it and then DTS or bcp data over from the backed up database to the newly created one, and then you can recreate the users. This problem indicates to me some level of corruption, so if I were in this situation I cannot have a corrupt database, and therefore I would rebuild.

***************************************
Death must absolutely come to enemies of the code!
Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-10-28 : 17:02:50
quote:

I know this is not what you want to hear,


Actually royv, I want to hear it. I'll try it and get back to you....

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

Lee
Starting Member

1 Post

Posted - 2002-10-29 : 18:38:08
I had the same problem once before. I thought I ran DBCC checkdb, and then it went away.

Lee

=================================
I know this is not what you want to hear, [/quote]

Actually royv, I want to hear it. I'll try it and get back to you....

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
[/quote]

Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-10-29 : 18:44:27
Hi Lee

Thanks - I'll give it a go.
--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"

Edited by - rrb on 10/29/2002 18:45:29
Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-10-29 : 19:01:51
No luck - thanks for trying....

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

royv
Constraint Violating Yak Guru

455 Posts

Posted - 2002-10-30 : 09:39:48
No luck with the DBCC or no luck with the rebuild?

***************************************
Death must absolutely come to enemies of the code!
Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-10-30 : 19:08:30
Apologies - I meant no luck with DBCC

I haven't quite got to the rebuild yet....(looks like next on my list)

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

sherrer

64 Posts

Posted - 2002-10-31 : 16:16:43
This happens when id of the user associated with the database is different that the id in the server security. Normally caused by restoring a db on a different server than it was built with. Even if the user is added to the new server, the user will get a different id.

You can set the property to allow modifications to system catalogs, then VERY CAREFULLY go to the sysusers table in your database and delete the user from the table. Once you have done so, you will be able to add the user back to the database with no problem. Then if I were you I would set the allow modifications back.

Go to Top of Page

izaltsman
A custom title

1139 Posts

Posted - 2002-10-31 : 16:21:32
Did you run DBCC CHECKCATALOG?

Also you might want to try running sp_revokedbaccess -- it is pretty much the same thing as sp_dropuser, except doesn't perform this "user doesn't exist in db check"...

Deleting from sysusers might be tricky (you need to account for the related data in syspermissions and sysusers). You are better off with sp_revokedbaccess

Edited by - izaltsman on 10/31/2002 16:26:19
Go to Top of Page

M.E.
Aged Yak Warrior

539 Posts

Posted - 2002-10-31 : 16:29:19
Have you tried reciting poetry to it?

I have had this problem before (soemthing simular atleast) and the recreation looks best. If you've identified this one, I would wonder if there are other cases of this (or other bugs) throughout your db that you haven't found yet. That was the reasoning used here. So a full recreate and the problem hasn't came back yet.

It may be that it is deleted, only the GUI is still showing it. Can you still log in through this ID?

-----------------------
SQL isn't just a hobby, It's an addiction
Go to Top of Page

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2002-11-03 : 17:37:34
quote:

Have you tried reciting poetry to it?



Sorry, I only write lymmericks and I'm sure they don't qualify...

sp_revokedbacess did the trick - thanks Ilya

PS (Mark - you're totally right of course, a rebuild is in order. Will put it on his list of "things to do" )

Cheers all and thanks for the help - really appreciated!

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page

ksw
Starting Member

24 Posts

Posted - 2002-11-12 : 11:29:18
I just had the same issue. It must be a behavioral thing. I detached a database from one server, copied the files to a second server, and attached the db. The user didn't show up in EM, but it errored when I tried to create the user on the new server. Maybe if the user had already existed on the new server, the SQL Server could have automatically mapped the user correctly.

I used izaltsman's suggestion of using sp_revokedbaccess and it worked perfectly.

--KSW

Go to Top of Page
   

- Advertisement -