Showing posts with label exists. Show all posts
Showing posts with label exists. Show all posts

Monday, March 19, 2012

errors to log

what a want to know is if there s a way to log sql server errors on a log file, table, these errors are not sql server logs which already exists, i want to log dead locks, sql server timeout errors vs on sql server or somewhere.

is it possible ?

may i use sql server profiler for that purpose?

thx in advance..

You can set up SQL Server Alerts that can log to the Application Event Log, or you could write some custom code to log intersing information to a SQL Server database table.

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.
>
>

Error21002 user name already exists

Hi I am trying to give database access to a second database for a user and a
m
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 tha
t
>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 rol
e
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 wi
th
> 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...
>
>|||it worked, thanks.
--
Paul G
Software engineer.
"Hari Prasad" wrote:

> Hi,
> Seems that SID for the existing user inside the database is in mismatch wi
th
> 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...
>
>

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...
>
>
|||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...
>
>