Home > Archive > MS SQL Server > August 2005 > Error21002 user name already exists









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Error21002 user name already exists
Paul

2005-08-17, 8:23 pm

Hi I am trying to give database access to a second database for a user and am
getting the error (Error 21002 username allready exists). Anyhow seems that
I ran into the problem before and ran a command from query analyzer and it
seemed to fix it. Anyhow can not remember the command I used.
thanks.
--
Paul G
Software engineer.
ChrisR

2005-08-17, 8:23 pm

sp_dropuser?


"Paul" <Paul@discussions.microsoft.com> wrote in message
news:2E83131E-CB3C-4824-882B- 2DE85A6B6975@microso
ft.com...
> Hi I am trying to give database access to a second database for a user and
> am
> getting the error (Error 21002 username allready exists). Anyhow seems
> that
> I ran into the problem before and ran a command from query analyzer and it
> seemed to fix it. Anyhow can not remember the command I used.
> thanks.
> --
> Paul G
> Software engineer.



Sue Hoegemeier

2005-08-18, 3:23 am

Sounds like it may have been sp_change_users_logi
n
See books online for details.

-Sue

On Wed, 17 Aug 2005 16:39:01 -0700, "Paul"
<Paul@discussions.microsoft.com> wrote:

>Hi I am trying to give database access to a second database for a user and am
>getting the error (Error 21002 username allready exists). Anyhow seems that
>I ran into the problem before and ran a command from query analyzer and it
>seemed to fix it. Anyhow can not remember the command I used.
>thanks.


doller

2005-08-18, 3:23 am

Hi,
U are searching for this
exec sp_addrolemember N'db_datareader', N'username
hope this helps u
from]
killer'

Hari Prasad

2005-08-18, 9:33 am

Hi,

Seems that SID for the existing user inside the database is in mismatch with
Login inside syslogins. So goahead and use the
system stored procedure sp_change_users_logi
n (see books online) as Sue
pointed out to fix the mis match.

Thanks
Hari
SQL Server MVP




"Paul" <Paul@discussions.microsoft.com> wrote in message
news:2E83131E-CB3C-4824-882B- 2DE85A6B6975@microso
ft.com...
> Hi I am trying to give database access to a second database for a user and
> am
> getting the error (Error 21002 username allready exists). Anyhow seems
> that
> I ran into the problem before and ran a command from query analyzer and it
> seemed to fix it. Anyhow can not remember the command I used.
> thanks.
> --
> Paul G
> Software engineer.



Paul

2005-08-18, 11:23 am

Hi thanks for the response. the error I am getting now is 15023 user or role
already exists in the current database when I tried to give database access
of a second database to the user. I tried the sp_change_users_logi
n
'AUTO_FIX','username
' command. I am able to give the user access to one
dbase but not the other.

--
Paul G
Software engineer.


"Hari Prasad" wrote:

> Hi,
>
> Seems that SID for the existing user inside the database is in mismatch with
> Login inside syslogins. So goahead and use the
> system stored procedure sp_change_users_logi
n (see books online) as Sue
> pointed out to fix the mis match.
>
> Thanks
> Hari
> SQL Server MVP
>
>
>
>
> "Paul" <Paul@discussions.microsoft.com> wrote in message
> news:2E83131E-CB3C-4824-882B- 2DE85A6B6975@microso
ft.com...
>
>
>

Paul

2005-08-18, 8:23 pm

it worked, thanks.
--
Paul G
Software engineer.


"Hari Prasad" wrote:

> Hi,
>
> Seems that SID for the existing user inside the database is in mismatch with
> Login inside syslogins. So goahead and use the
> system stored procedure sp_change_users_logi
n (see books online) as Sue
> pointed out to fix the mis match.
>
> Thanks
> Hari
> SQL Server MVP
>
>
>
>
> "Paul" <Paul@discussions.microsoft.com> wrote in message
> news:2E83131E-CB3C-4824-882B- 2DE85A6B6975@microso
ft.com...
>
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com