Friday, February 24, 2012

Microsoft SQL-DMO(ODBC SQLState:42000)

I am getting the following error message in SQL 2K when I try to give
database access to a login Id "LogInId1".
*****************************************************
Microsoft SQL-DMO(ODBC SQLState:42000)
Error 15023: User or role 'LogInId1' already exists in the current database.
****************************************************************************
*
The "public" role in the above "current database" has a user Id "LogInId1".
This is the one it is generating the above error message. I can not remove
the above user ID from that role (public).
What I did to generate the above error message?
I restored one user database on SQL 2K (running under windows 2003) from the
backup of SQL2K running under Win2K. The user Id "LogInId1" existed in the
database from which back was ran.
How to add database access permissions to the login Id ""LogInId1"?
Thank you,
SmithYou can try:
exec sp_changedbowner 'LogInId1'
"John Smith" wrote:
> I am getting the following error message in SQL 2K when I try to give
> database access to a login Id "LogInId1".
>
> *****************************************************
> Microsoft SQL-DMO(ODBC SQLState:42000)
> Error 15023: User or role 'LogInId1' already exists in the current database.
> ****************************************************************************
> *
>
> The "public" role in the above "current database" has a user Id "LogInId1".
> This is the one it is generating the above error message. I can not remove
> the above user ID from that role (public).
>
> What I did to generate the above error message?
> I restored one user database on SQL 2K (running under windows 2003) from the
> backup of SQL2K running under Win2K. The user Id "LogInId1" existed in the
> database from which back was ran.
>
> How to add database access permissions to the login Id ""LogInId1"?
> Thank you,
> Smith
>
>
>|||Take a look at sp_resolve_logins in BOL, etc.
The internal (to the database) user tables have entries that are either not
in the Master SYSLOGINS table or have different pointers to that table. You
need to either repoint(resolve) or remove those logins.
--
Joseph R.P. Maloney, CSP,CCP,CDP
"Fahim" wrote:
> You can try:
> exec sp_changedbowner 'LogInId1'
>
> "John Smith" wrote:
> > I am getting the following error message in SQL 2K when I try to give
> > database access to a login Id "LogInId1".
> >
> >
> >
> > *****************************************************
> >
> > Microsoft SQL-DMO(ODBC SQLState:42000)
> >
> > Error 15023: User or role 'LogInId1' already exists in the current database.
> >
> > ****************************************************************************
> > *
> >
> >
> >
> > The "public" role in the above "current database" has a user Id "LogInId1".
> > This is the one it is generating the above error message. I can not remove
> > the above user ID from that role (public).
> >
> >
> >
> > What I did to generate the above error message?
> >
> > I restored one user database on SQL 2K (running under windows 2003) from the
> > backup of SQL2K running under Win2K. The user Id "LogInId1" existed in the
> > database from which back was ran.
> >
> >
> >
> > How to add database access permissions to the login Id ""LogInId1"?
> >
> > Thank you,
> >
> > Smith
> >
> >
> >
> >
> >

No comments:

Post a Comment