Home All Groups Group Topic Archive Search About

where to find the errors generated by stored procedures



Author
9 Dec 2008 4:48 PM
SarahG
Hi,

I have a silly question. I'm using sql2000 and there are a lot of stored
procedures. I would like to trace the error which one of the procedures
throws, where can I find it? Would it appear in sql log or event log?

Thanks,
Sarah

Author
9 Dec 2008 7:22 PM
John Bell
"SarahG" <Sar***@discussions.microsoft.com> wrote in message
news:BCD1FDB4-499E-4300-B7E0-5F2DCC3D45B8@microsoft.com...
> Hi,
>
> I have a silly question. I'm using sql2000 and there are a lot of stored
> procedures. I would like to trace the error which one of the procedures
> throws, where can I find it? Would it appear in sql log or event log?
>
> Thanks,
> Sarah

Hi

There is no set place for errors raised by stored procedures, it would
usually be up to your application to log them. You may want to read
http://www.sommarskog.se/error-handling-I.html and
http://www.sommarskog.se/error-handling-II.html

You could use SQL Profilers and look at the exceptions using the Exception
Event in the Errors and Warnings class. You will need to look at the
Statement events to find out which statement raises the exception.

John
Are all your drivers up to date? click for free checkup

Author
9 Dec 2008 7:26 PM
Tibor Karaszi
Some errors are logged to Errorlog/Eventlog. For errors that are in
sysmessages, you can check the dlevel column for that error number. If
the error message isn't setup to log, or is dynamically executed
(RAISERROR without the WITH LOG clause) then the error isn't logged
anywhere. Regular "user errors" are not logged by default.

Show quoteHide quote
"SarahG" <Sar***@discussions.microsoft.com> wrote in message
news:BCD1FDB4-499E-4300-B7E0-5F2DCC3D45B8@microsoft.com...
> Hi,
>
> I have a silly question. I'm using sql2000 and there are a lot of
> stored
> procedures. I would like to trace the error which one of the
> procedures
> throws, where can I find it? Would it appear in sql log or event
> log?
>
> Thanks,
> Sarah
Author
9 Dec 2008 7:56 PM
SarahG
Thanks John and Tibor, the information is very helpful

Sarah

Show quoteHide quote
"Tibor Karaszi" wrote:

> Some errors are logged to Errorlog/Eventlog. For errors that are in
> sysmessages, you can check the dlevel column for that error number. If
> the error message isn't setup to log, or is dynamically executed
> (RAISERROR without the WITH LOG clause) then the error isn't logged
> anywhere. Regular "user errors" are not logged by default.
>
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://sqlblog.com/blogs/tibor_karaszi
>
>
> "SarahG" <Sar***@discussions.microsoft.com> wrote in message
> news:BCD1FDB4-499E-4300-B7E0-5F2DCC3D45B8@microsoft.com...
> > Hi,
> >
> > I have a silly question. I'm using sql2000 and there are a lot of
> > stored
> > procedures. I would like to trace the error which one of the
> > procedures
> > throws, where can I find it? Would it appear in sql log or event
> > log?
> >
> > Thanks,
> > Sarah
>
>

Bookmark and Share