Wednesday, March 7, 2012

Error21002 user name already exists

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.sp_dropuser?
"Paul" <Paul@.discussions.microsoft.com> wrote in message
news:2E83131E-CB3C-4824-882B-2DE85A6B6975@.microsoft.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.|||Sounds like it may have been sp_change_users_login
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.|||Hi,
U are searching for this
exec sp_addrolemember N'db_datareader', N'username
hope this helps u
from]
killer'|||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_login (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@.microsoft.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.|||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_login
'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_login (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@.microsoft.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.
>
>|||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_login (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@.microsoft.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.
>
>

No comments:

Post a Comment