Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Capture error description

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-01-14 : 07:54:59
Dan writes "How can I capture the error description within a stored procedure. Server: Such as

Msg 208, Level 16, State 1, Procedure sp_earnings_first_pull, Line 23
Invalid object name 'MYTable'.

Thanks Dan"

nr
SQLTeam MVY

12543 Posts

Posted - 2004-01-14 : 08:13:23
You can't, the SP has failed to compile so will not execute so you cannot trap this error within it.
For trappable errors see
http://www.nigelrivett.net/spFormatOutputBuffer.html

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2004-01-14 : 10:21:05
You've hit a syntax/context error....post the code.....and this may advance further.
Go to Top of Page
   

- Advertisement -