Showing posts with label errors. Show all posts
Showing posts with label errors. Show all posts

Monday, March 19, 2012

login failed events for administrator account??

Hi,
I see a lot of login failed errors in the event log.
its the domain\administrator account.
the data associated to this event is:
<server name>.master
I suppose its an access to the master database the reason of this error.
but the user has access to this database.
the event is generated every 10 minutes and 5 minutes later then again 10
minutes...
any idea?
thanks.
Jerome.Maybe some service is trying to connect? You could get more data with
Profiler, tray to catch this login failed event.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Jj" <willgart@.AAAhotmailBBB.com> wrote in message
news:OL$RqwBrFHA.3424@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I see a lot of login failed errors in the event log.
> its the domain\administrator account.
> the data associated to this event is:
> <server name>.master
> I suppose its an access to the master database the reason of this error.
> but the user has access to this database.
> the event is generated every 10 minutes and 5 minutes later then again 10
> minutes...
> any idea?
> thanks.
> Jerome.
>|||I have identified that its portal server the service which generate this
error.
I try to change some config in sharepoint, but the error is here again.
also this account access all databases without any problem, portal server
generates a lot of access but only 1 (but unidentified) of these requests
failed.
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:OufyX6FrFHA.2008@.TK2MSFTNGP10.phx.gbl...
> Maybe some service is trying to connect? You could get more data with
> Profiler, tray to catch this login failed event.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
> "Jj" <willgart@.AAAhotmailBBB.com> wrote in message
> news:OL$RqwBrFHA.3424@.TK2MSFTNGP14.phx.gbl...
>

login failed events for administrator account??

Hi,
I see a lot of login failed errors in the event log.
its the domain\administrator account.
the data associated to this event is:
<server name>.master
I suppose its an access to the master database the reason of this error.
but the user has access to this database.
the event is generated every 10 minutes and 5 minutes later then again 10
minutes...
any idea?
thanks.
Jerome.Maybe some service is trying to connect? You could get more data with
Profiler, tray to catch this login failed event.
--
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Jéjé" <willgart@.AAAhotmailBBB.com> wrote in message
news:OL$RqwBrFHA.3424@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I see a lot of login failed errors in the event log.
> its the domain\administrator account.
> the data associated to this event is:
> <server name>.master
> I suppose its an access to the master database the reason of this error.
> but the user has access to this database.
> the event is generated every 10 minutes and 5 minutes later then again 10
> minutes...
> any idea?
> thanks.
> Jerome.
>|||I have identified that its portal server the service which generate this
error.
I try to change some config in sharepoint, but the error is here again.
also this account access all databases without any problem, portal server
generates a lot of access but only 1 (but unidentified) of these requests
failed.
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> wrote in
message news:OufyX6FrFHA.2008@.TK2MSFTNGP10.phx.gbl...
> Maybe some service is trying to connect? You could get more data with
> Profiler, tray to catch this login failed event.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
> "Jéjé" <willgart@.AAAhotmailBBB.com> wrote in message
> news:OL$RqwBrFHA.3424@.TK2MSFTNGP14.phx.gbl...
>> Hi,
>> I see a lot of login failed errors in the event log.
>> its the domain\administrator account.
>> the data associated to this event is:
>> <server name>.master
>> I suppose its an access to the master database the reason of this error.
>> but the user has access to this database.
>> the event is generated every 10 minutes and 5 minutes later then again 10
>> minutes...
>> any idea?
>> thanks.
>> Jerome.
>

login failed events for administrator account??

Hi,
I see a lot of login failed errors in the event log.
its the domain\administrator account.
the data associated to this event is:
<server name>.master
I suppose its an access to the master database the reason of this error.
but the user has access to this database.
the event is generated every 10 minutes and 5 minutes later then again 10
minutes...
any idea?
thanks.
Jerome.
Maybe some service is trying to connect? You could get more data with
Profiler, tray to catch this login failed event.
Dejan Sarka, SQL Server MVP
Associate Mentor
www.SolidQualityLearning.com
"Jj" <willgart@.AAAhotmailBBB.com> wrote in message
news:OL$RqwBrFHA.3424@.TK2MSFTNGP14.phx.gbl...
> Hi,
> I see a lot of login failed errors in the event log.
> its the domain\administrator account.
> the data associated to this event is:
> <server name>.master
> I suppose its an access to the master database the reason of this error.
> but the user has access to this database.
> the event is generated every 10 minutes and 5 minutes later then again 10
> minutes...
> any idea?
> thanks.
> Jerome.
>
|||I have identified that its portal server the service which generate this
error.
I try to change some config in sharepoint, but the error is here again.
also this account access all databases without any problem, portal server
generates a lot of access but only 1 (but unidentified) of these requests
failed.
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si > wrote in
message news:OufyX6FrFHA.2008@.TK2MSFTNGP10.phx.gbl...
> Maybe some service is trying to connect? You could get more data with
> Profiler, tray to catch this login failed event.
> --
> Dejan Sarka, SQL Server MVP
> Associate Mentor
> www.SolidQualityLearning.com
> "Jj" <willgart@.AAAhotmailBBB.com> wrote in message
> news:OL$RqwBrFHA.3424@.TK2MSFTNGP14.phx.gbl...
>

Monday, March 12, 2012

Login errors and network errors

Where can I find errors due to network and unsuccessful client login errors in the SQL server side. I saw the SQL error log, but cannot find any.
Thanks.
Retna
You can define auidit level under security tab whether login was succed or
failed.
"Retna" <Retna@.discussions.microsoft.com> wrote in message
news:20D7D513-D409-4BAE-B6B8-6A8E3946FAF2@.microsoft.com...
> Where can I find errors due to network and unsuccessful client login
errors in the SQL server side. I saw the SQL error log, but cannot find any.
> Thanks.

Login errors and network errors

Where can I find errors due to network and unsuccessful client login errors
in the SQL server side. I saw the SQL error log, but cannot find any.
Thanks.Retna
You can define auidit level under security tab whether login was succed or
failed.
"Retna" <Retna@.discussions.microsoft.com> wrote in message
news:20D7D513-D409-4BAE-B6B8-6A8E3946FAF2@.microsoft.com...
> Where can I find errors due to network and unsuccessful client login
errors in the SQL server side. I saw the SQL error log, but cannot find any.
> Thanks.

Login errors and network errors

Where can I find errors due to network and unsuccessful client login errors in the SQL server side. I saw the SQL error log, but cannot find any.
Thanks.Retna
You can define auidit level under security tab whether login was succed or
failed.
"Retna" <Retna@.discussions.microsoft.com> wrote in message
news:20D7D513-D409-4BAE-B6B8-6A8E3946FAF2@.microsoft.com...
> Where can I find errors due to network and unsuccessful client login
errors in the SQL server side. I saw the SQL error log, but cannot find any.
> Thanks.

Wednesday, March 7, 2012

logical inserted table and after triggers

for some reason my create trigger query fails because sql server cannot resolve the term inserted. It won't even parse without errors. This is what my t-sql looks like

CREATE TRIGGER UserTypeTrig ON GTData.dbo.GTUserType

AFTER Insert, Update

AS

SET NOCOUNT ON

IF EXISTS(SELECT *

FROM GTData.dbo.GTUserType G

JOIN INSERTED I

ON G.TypeID != I.TypeID AND LOWER(G.UserType) = LOWER(I.UserType);

BEGIN;

RAISERROR('cannot insert duplicate userType', 16, 1)

ROLLBACK TRANSACTION

RETURN

END;

appreciate all the help i can get.

Your syntax is not correct. You are using statement terminators in the wrong place. See the modified code:

CREATE TRIGGER UserTypeTrig ON GTData.dbo.GTUserType

AFTER Insert, Update

AS

SET NOCOUNT ON;

IF EXISTS(SELECT *

FROM GTData.dbo.GTUserType G

JOIN INSERTED I

ON G.TypeID != I.TypeID AND LOWER(G.UserType) = LOWER(I.UserType)

)

BEGIN;

RAISERROR('cannot insert duplicate userType', 16, 1);

ROLLBACK TRANSACTION;

RETURN;

END;

|||

Umachandar Jayachandran

Thanks a lot!

Friday, February 24, 2012

Logging: Can't disable Informational Events

I enabled Windows Events for OnError, OnTaskFailed, OnWarning for my package and subelements. However, even if no errors occur, I still get Informational Events generated even though those are disabled for all modules and packages.

Any way to disable Information Events? Is this an SSIS defect, or just an oddity of how it implements Windows Events?

Windows Event:
Source: SQLISPackage
Type: Information
Event ID: 12288
Description: Package "XXXXXX" started.

Event ID: 122289
Description: Package "XXXXXX" finished successfully.

faype02 wrote:

I enabled Windows Events for OnError, OnTaskFailed, OnWarning for my package and subelements. However, even if no errors occur, I still get Informational Events generated even though those are disabled for all modules and packages.

Any way to disable Information Events? Is this an SSIS defect, or just an oddity of how it implements Windows Events?

Windows Event:
Source: SQLISPackage
Type: Information
Event ID: 12288
Description: Package "XXXXXX" started.

Event ID: 122289
Description: Package "XXXXXX" finished successfully.

Oh yeah, I can reproduce that. Weird - I don't think those should be there.

[Microsoft follow-up] Is this a bug or by design?

-Jamie

|||

It appears that this is by design see:

http://www.microsoft.com/technet/prodtechnol/sql/2005/mgngssis.mspx

In section on "Custom Log Provider" it says:

"To facilitate operations management, SSIS packages always write some basic logging information to the Windows event log, even for packages that do not incorporate logging. SSIS packages write events for package initiation and package completion and they can be identified using either the SQLISPackage or SQLISService event sources."

It would be a lovely option to be able to disable this.

Regards

|||So if I have a package that executes every 30 seconds, I have no control over thousands of "package start" and "package finished" log events per day?

There must be a way to intercept these with an event handler in the package - how would this be done?

Logging thousands of errors

I'm receiving these two errors again and again:

Windows cannot load extensible counter DLL MSSQL$MSFW, the first DWORD in data section is the Windows error code.

Windows cannot load extensible counter DLL MSSQL$SBSMONITORING, the first DWORD in data section is the Windows error code.

What might be generating them and how can I cure it?

The system is SBS 2003 R2 Premium.

Thanks.

Where are you seeing these errors?|||I am also getting thousands of these errors in the application log of 3 SBS machines.

They are all running SBS 2k3 sp1, at least 1 of them is R2 version of 2k3.
|||According to the KB article below, it is a permissions issue:

"To resolve this problem, you must grant the Read & Execute permission to the Network Service account on the performance counter DLL for SQL Server 2005 Analysis Services.

http://support.microsoft.com/kb/912399|||

The 912399 article says:

RESOLUTION

To resolve this problem, you must grant the Read & Execute permission to the Network Service account on the performance counter DLL for SQL Server 2005 Analysis Services. The DLL is located in the following folder:

C:\Program Files\Microsoft SQL Server\MSSQL.x\OLAP\Bin\Msmdctr90.dll

Additionally, you must grant Read permissions to the Network Service account on the "bin" directory and the "bin\en" directory for SQL Server 2005 Analysis Services. For example:

? C:\Program Files\Microsoft SQL Server\MSSQL.x\OLAP\bin ? C:\Program Files\Microsoft SQL Server\MSSQL.x\OLAP\bin\en

I didn't have those specific directories, but I gave Network Service permissions for any similarly named directories and it fixed the problem. Thanks

Any idea what created the problem to begin with?

|||

I have this problem for an earlier MSSQL server version which does not have the same structure. does anyone know the method for this?

Monday, February 20, 2012

Logging severity levels less than 19 ?

sp_altermessage can be usefull only when I know message number.
But what to do when I want to log all errors with severity 10, 11, 12, etc ?
Albert Lyubarsky
Comtec LTD
IsraelAlbert, shalom
[url]http://www.sqlservercentral.com/columnists/RDyess/traceflags_printversion.asp[/url
]
Lookup 2701 tracse flag
"albertly" <mynickalbert@.community.nospam> wrote in message
news:717D3800-19F9-42A4-9E53-BDB3FD373156@.microsoft.com...
> sp_altermessage can be usefull only when I know message number.
> But what to do when I want to log all errors with severity 10, 11, 12, etc
> ?
> --
> Albert Lyubarsky
> Comtec LTD
> Israel

Logging severity levels less than 19 ?

sp_altermessage can be usefull only when I know message number.
But what to do when I want to log all errors with severity 10, 11, 12, etc ?
--
Albert Lyubarsky
Comtec LTD
IsraelAlbert, shalom
http://www.sqlservercentral.com/columnists/RDyess/traceflags_printversion.asp
Lookup 2701 tracse flag
"albertly" <mynickalbert@.community.nospam> wrote in message
news:717D3800-19F9-42A4-9E53-BDB3FD373156@.microsoft.com...
> sp_altermessage can be usefull only when I know message number.
> But what to do when I want to log all errors with severity 10, 11, 12, etc
> ?
> --
> Albert Lyubarsky
> Comtec LTD
> Israel

Logging server errors

How or where does one get *meaningful* error logs from SQL Server/SQL Agent?
The logs generated on SQL Server are wholly inadequate, unless I am missing
something. A sample - trying to find out why my Integrity Checks job failed
last night:
DBCC CHECKDB (gIQInternetMaster, repair_fast) executed by NV\SQL_USR found 4
errors and repaired 0 errors.
So I look in the Application Event log for the machine:
SQL Server Scheduled Job 'Integrity Checks Job for DB Maintenance Plan 'DB
Maintenance Plan gIQInternetMaster'' (0x834A8604584AB24AB32FDA8DF8B39468) -
Status: Failed - Invoked on: 2004-09-30 00:00:01 - Message: The job failed.
The Job was invoked by Schedule 35 (Schedule 1). The last step to run was
step 1 (Step 1).
Is there something in that message I'm missing?
Specify an output file in the jobstep. Note that this is in the job *step*.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Ron Hinds" <__NoSpam@.__NoSpamramac.com> wrote in message
news:emJg3EwpEHA.3980@.TK2MSFTNGP12.phx.gbl...
> How or where does one get *meaningful* error logs from SQL Server/SQL Agent?
> The logs generated on SQL Server are wholly inadequate, unless I am missing
> something. A sample - trying to find out why my Integrity Checks job failed
> last night:
> DBCC CHECKDB (gIQInternetMaster, repair_fast) executed by NV\SQL_USR found 4
> errors and repaired 0 errors.
> So I look in the Application Event log for the machine:
> SQL Server Scheduled Job 'Integrity Checks Job for DB Maintenance Plan 'DB
> Maintenance Plan gIQInternetMaster'' (0x834A8604584AB24AB32FDA8DF8B39468) -
> Status: Failed - Invoked on: 2004-09-30 00:00:01 - Message: The job failed.
> The Job was invoked by Schedule 35 (Schedule 1). The last step to run was
> step 1 (Step 1).
> Is there something in that message I'm missing?
>
>
|||Thank you!
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23MEtBywpEHA.324@.TK2MSFTNGP11.phx.gbl...
> Specify an output file in the jobstep. Note that this is in the job
*step*.[vbcol=seagreen]
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Ron Hinds" <__NoSpam@.__NoSpamramac.com> wrote in message
> news:emJg3EwpEHA.3980@.TK2MSFTNGP12.phx.gbl...
Agent?[vbcol=seagreen]
missing[vbcol=seagreen]
failed[vbcol=seagreen]
found 4[vbcol=seagreen]
'DB[vbcol=seagreen]
(0x834A8604584AB24AB32FDA8DF8B39468) -[vbcol=seagreen]
failed.[vbcol=seagreen]
was
>

Logging server errors

How or where does one get *meaningful* error logs from SQL Server/SQL Agent?
The logs generated on SQL Server are wholly inadequate, unless I am missing
something. A sample - trying to find out why my Integrity Checks job failed
last night:
DBCC CHECKDB (gIQInternetMaster, repair_fast) executed by NV\SQL_USR found 4
errors and repaired 0 errors.
So I look in the Application Event log for the machine:
SQL Server Scheduled Job 'Integrity Checks Job for DB Maintenance Plan 'DB
Maintenance Plan gIQInternetMaster'' (0x834A8604584AB24AB32FDA8DF8B39468) -
Status: Failed - Invoked on: 2004-09-30 00:00:01 - Message: The job failed.
The Job was invoked by Schedule 35 (Schedule 1). The last step to run was
step 1 (Step 1).
Is there something in that message I'm missing?
Specify an output file in the jobstep. Note that this is in the job *step*.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Ron Hinds" <__NoSpam@.__NoSpamramac.com> wrote in message
news:emJg3EwpEHA.3980@.TK2MSFTNGP12.phx.gbl...
> How or where does one get *meaningful* error logs from SQL Server/SQL Agent?
> The logs generated on SQL Server are wholly inadequate, unless I am missing
> something. A sample - trying to find out why my Integrity Checks job failed
> last night:
> DBCC CHECKDB (gIQInternetMaster, repair_fast) executed by NV\SQL_USR found 4
> errors and repaired 0 errors.
> So I look in the Application Event log for the machine:
> SQL Server Scheduled Job 'Integrity Checks Job for DB Maintenance Plan 'DB
> Maintenance Plan gIQInternetMaster'' (0x834A8604584AB24AB32FDA8DF8B39468) -
> Status: Failed - Invoked on: 2004-09-30 00:00:01 - Message: The job failed.
> The Job was invoked by Schedule 35 (Schedule 1). The last step to run was
> step 1 (Step 1).
> Is there something in that message I'm missing?
>
>
|||Thank you!
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23MEtBywpEHA.324@.TK2MSFTNGP11.phx.gbl...
> Specify an output file in the jobstep. Note that this is in the job
*step*.[vbcol=seagreen]
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Ron Hinds" <__NoSpam@.__NoSpamramac.com> wrote in message
> news:emJg3EwpEHA.3980@.TK2MSFTNGP12.phx.gbl...
Agent?[vbcol=seagreen]
missing[vbcol=seagreen]
failed[vbcol=seagreen]
found 4[vbcol=seagreen]
'DB[vbcol=seagreen]
(0x834A8604584AB24AB32FDA8DF8B39468) -[vbcol=seagreen]
failed.[vbcol=seagreen]
was
>

Logging server errors

How or where does one get *meaningful* error logs from SQL Server/SQL Agent?
The logs generated on SQL Server are wholly inadequate, unless I am missing
something. A sample - trying to find out why my Integrity Checks job failed
last night:
DBCC CHECKDB (gIQInternetMaster, repair_fast) executed by NV\SQL_USR found 4
errors and repaired 0 errors.
So I look in the Application Event log for the machine:
SQL Server Scheduled Job 'Integrity Checks Job for DB Maintenance Plan 'DB
Maintenance Plan gIQInternetMaster'' (0x834A8604584AB24AB32FDA8DF8B39468) -
Status: Failed - Invoked on: 2004-09-30 00:00:01 - Message: The job failed.
The Job was invoked by Schedule 35 (Schedule 1). The last step to run was
step 1 (Step 1).
Is there something in that message I'm missing?Specify an output file in the jobstep. Note that this is in the job *step*.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Ron Hinds" <__NoSpam@.__NoSpamramac.com> wrote in message
news:emJg3EwpEHA.3980@.TK2MSFTNGP12.phx.gbl...
> How or where does one get *meaningful* error logs from SQL Server/SQL Agent?
> The logs generated on SQL Server are wholly inadequate, unless I am missing
> something. A sample - trying to find out why my Integrity Checks job failed
> last night:
> DBCC CHECKDB (gIQInternetMaster, repair_fast) executed by NV\SQL_USR found 4
> errors and repaired 0 errors.
> So I look in the Application Event log for the machine:
> SQL Server Scheduled Job 'Integrity Checks Job for DB Maintenance Plan 'DB
> Maintenance Plan gIQInternetMaster'' (0x834A8604584AB24AB32FDA8DF8B39468) -
> Status: Failed - Invoked on: 2004-09-30 00:00:01 - Message: The job failed.
> The Job was invoked by Schedule 35 (Schedule 1). The last step to run was
> step 1 (Step 1).
> Is there something in that message I'm missing?
>
>|||Thank you!
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%23MEtBywpEHA.324@.TK2MSFTNGP11.phx.gbl...
> Specify an output file in the jobstep. Note that this is in the job
*step*.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Ron Hinds" <__NoSpam@.__NoSpamramac.com> wrote in message
> news:emJg3EwpEHA.3980@.TK2MSFTNGP12.phx.gbl...
> > How or where does one get *meaningful* error logs from SQL Server/SQL
Agent?
> > The logs generated on SQL Server are wholly inadequate, unless I am
missing
> > something. A sample - trying to find out why my Integrity Checks job
failed
> > last night:
> >
> > DBCC CHECKDB (gIQInternetMaster, repair_fast) executed by NV\SQL_USR
found 4
> > errors and repaired 0 errors.
> >
> > So I look in the Application Event log for the machine:
> >
> > SQL Server Scheduled Job 'Integrity Checks Job for DB Maintenance Plan
'DB
> > Maintenance Plan gIQInternetMaster''
(0x834A8604584AB24AB32FDA8DF8B39468) -
> > Status: Failed - Invoked on: 2004-09-30 00:00:01 - Message: The job
failed.
> > The Job was invoked by Schedule 35 (Schedule 1). The last step to run
was
> > step 1 (Step 1).
> >
> > Is there something in that message I'm missing?
> >
> >
> >
>

Logging query errors

Hi,
Is there a way to log errors raised while running a query. For instance a
table contains a duplicate entry and a scheduled query notices this. Is it
then possible to get an alert in for instance the SQL log?
Greets,
Fred
Fred
If you are on SQL Server 2005 take a look at Notification Services in the
BOL
One method is
IF EXISTS(SELECT *
FROM TableA
WHERE col = @.key
GROUP BY col
HAVING COUNT(*)>1)
BEGIN
RAISERROR ('There are duplicates in the table',16, 1)
END
ELSE
"Fred Wouters" <f.wouters@.tigra-tuning.nl> wrote in message
news:788AA79C-20C2-438B-9556-8AFF574B129B@.microsoft.com...
> Hi,
> Is there a way to log errors raised while running a query. For instance a
> table contains a duplicate entry and a scheduled query notices this. Is it
> then possible to get an alert in for instance the SQL log?
> Greets,
> Fred
|||I'm using SQL 2000. Would the query below also work on 2000?
"Uri Dimant" wrote:

> Fred
> If you are on SQL Server 2005 take a look at Notification Services in the
> BOL
>
> One method is
> IF EXISTS(SELECT *
> FROM TableA
> WHERE col = @.key
> GROUP BY col
> HAVING COUNT(*)>1)
> BEGIN
> RAISERROR ('There are duplicates in the table',16, 1)
> END
> ELSE
>
>
> "Fred Wouters" <f.wouters@.tigra-tuning.nl> wrote in message
> news:788AA79C-20C2-438B-9556-8AFF574B129B@.microsoft.com...
>
>
|||Fred
Yes
"Fred Wouters" <f.wouters@.tigra-tuning.nl> wrote in message
news:AB5685F6-EF5D-4346-A4C0-A8D02D54DDFB@.microsoft.com...[vbcol=seagreen]
> I'm using SQL 2000. Would the query below also work on 2000?
> "Uri Dimant" wrote:

Logging query errors

Hi,
Is there a way to log errors raised while running a query. For instance a
table contains a duplicate entry and a scheduled query notices this. Is it
then possible to get an alert in for instance the SQL log?
Greets,
FredFred
If you are on SQL Server 2005 take a look at Notification Services in the
BOL
One method is
IF EXISTS(SELECT *
FROM TableA
WHERE col = @.key
GROUP BY col
HAVING COUNT(*)>1)
BEGIN
RAISERROR ('There are duplicates in the table',16, 1)
END
ELSE
"Fred Wouters" <f.wouters@.tigra-tuning.nl> wrote in message
news:788AA79C-20C2-438B-9556-8AFF574B129B@.microsoft.com...
> Hi,
> Is there a way to log errors raised while running a query. For instance a
> table contains a duplicate entry and a scheduled query notices this. Is it
> then possible to get an alert in for instance the SQL log?
> Greets,
> Fred|||Not really without catching that error in the client code. If you want to do this at the TSQL level:
2000: You can only capture the error number using @.@.ERROR
2005: You can capture almost anything you want, using functions such as ERROR_MESSAGE(),
ERROR_NUMBER(). Do read up on TRY/CATCH if you want to go this route.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Fred Wouters" <f.wouters@.tigra-tuning.nl> wrote in message
news:788AA79C-20C2-438B-9556-8AFF574B129B@.microsoft.com...
> Hi,
> Is there a way to log errors raised while running a query. For instance a
> table contains a duplicate entry and a scheduled query notices this. Is it
> then possible to get an alert in for instance the SQL log?
> Greets,
> Fred|||I'm using SQL 2000. Would the query below also work on 2000?
"Uri Dimant" wrote:
> Fred
> If you are on SQL Server 2005 take a look at Notification Services in the
> BOL
>
> One method is
> IF EXISTS(SELECT *
> FROM TableA
> WHERE col = @.key
> GROUP BY col
> HAVING COUNT(*)>1)
> BEGIN
> RAISERROR ('There are duplicates in the table',16, 1)
> END
> ELSE
>
>
> "Fred Wouters" <f.wouters@.tigra-tuning.nl> wrote in message
> news:788AA79C-20C2-438B-9556-8AFF574B129B@.microsoft.com...
> > Hi,
> >
> > Is there a way to log errors raised while running a query. For instance a
> > table contains a duplicate entry and a scheduled query notices this. Is it
> > then possible to get an alert in for instance the SQL log?
> >
> > Greets,
> >
> > Fred
>
>|||Fred
Yes
"Fred Wouters" <f.wouters@.tigra-tuning.nl> wrote in message
news:AB5685F6-EF5D-4346-A4C0-A8D02D54DDFB@.microsoft.com...
> I'm using SQL 2000. Would the query below also work on 2000?
> "Uri Dimant" wrote:
>> Fred
>> If you are on SQL Server 2005 take a look at Notification Services in the
>> BOL
>>
>> One method is
>> IF EXISTS(SELECT *
>> FROM TableA
>> WHERE col = @.key
>> GROUP BY col
>> HAVING COUNT(*)>1)
>> BEGIN
>> RAISERROR ('There are duplicates in the table',16, 1)
>> END
>> ELSE
>>
>>
>> "Fred Wouters" <f.wouters@.tigra-tuning.nl> wrote in message
>> news:788AA79C-20C2-438B-9556-8AFF574B129B@.microsoft.com...
>> > Hi,
>> >
>> > Is there a way to log errors raised while running a query. For instance
>> > a
>> > table contains a duplicate entry and a scheduled query notices this. Is
>> > it
>> > then possible to get an alert in for instance the SQL log?
>> >
>> > Greets,
>> >
>> > Fred
>>

Logging query errors

Hi,
Is there a way to log errors raised while running a query. For instance a
table contains a duplicate entry and a scheduled query notices this. Is it
then possible to get an alert in for instance the SQL log?
Greets,
FredFred
If you are on SQL Server 2005 take a look at Notification Services in the
BOL
One method is
IF EXISTS(SELECT *
FROM TableA
WHERE col = @.key
GROUP BY col
HAVING COUNT(*)>1)
BEGIN
RAISERROR ('There are duplicates in the table',16, 1)
END
ELSE
"Fred Wouters" <f.wouters@.tigra-tuning.nl> wrote in message
news:788AA79C-20C2-438B-9556-8AFF574B129B@.microsoft.com...
> Hi,
> Is there a way to log errors raised while running a query. For instance a
> table contains a duplicate entry and a scheduled query notices this. Is it
> then possible to get an alert in for instance the SQL log?
> Greets,
> Fred|||Not really without catching that error in the client code. If you want to do
this at the TSQL level:
2000: You can only capture the error number using @.@.ERROR
2005: You can capture almost anything you want, using functions such as ERRO
R_MESSAGE(),
ERROR_NUMBER(). Do read up on TRY/CATCH if you want to go this route.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Fred Wouters" <f.wouters@.tigra-tuning.nl> wrote in message
news:788AA79C-20C2-438B-9556-8AFF574B129B@.microsoft.com...
> Hi,
> Is there a way to log errors raised while running a query. For instance a
> table contains a duplicate entry and a scheduled query notices this. Is it
> then possible to get an alert in for instance the SQL log?
> Greets,
> Fred|||I'm using SQL 2000. Would the query below also work on 2000?
"Uri Dimant" wrote:

> Fred
> If you are on SQL Server 2005 take a look at Notification Services in the
> BOL
>
> One method is
> IF EXISTS(SELECT *
> FROM TableA
> WHERE col = @.key
> GROUP BY col
> HAVING COUNT(*)>1)
> BEGIN
> RAISERROR ('There are duplicates in the table',16, 1)
> END
> ELSE
>
>
> "Fred Wouters" <f.wouters@.tigra-tuning.nl> wrote in message
> news:788AA79C-20C2-438B-9556-8AFF574B129B@.microsoft.com...
>
>|||Fred
Yes
"Fred Wouters" <f.wouters@.tigra-tuning.nl> wrote in message
news:AB5685F6-EF5D-4346-A4C0-A8D02D54DDFB@.microsoft.com...[vbcol=seagreen]
> I'm using SQL 2000. Would the query below also work on 2000?
> "Uri Dimant" wrote:
>