|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
where to find the errors generated by stored procedures
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 "SarahG" <Sar***@discussions.microsoft.com> wrote in message Hinews: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 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 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 quoteTibor 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 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 > >
Other interesting topics
ORDER BY @OrderBy problem
Testing Environment + TestData + QA Setup Restoring single filegroup Migrating SQL2000 Databases to SQL2005 SSMS Sometimes shows keys - sometimes not 64 bit standard edition doesn't use page file Transaction Log Backup Doesn't Truncate Log Change autogrowth for a log file SQL 2005 Maintenance Plans Error: 18456, Severity: 14, State: 10. |
|||||||||||||||||||||||