Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using PRINT in a stored procedure, but not for errors

Status
Not open for further replies.

AndyInNC

Programmer
Sep 22, 2008
76
0
0
US
We have a really long, complicated stored procedure and, for tracking its progress, we have added PRINT statements showing the current location of the execution.

Like this:

[pre]-- Do long SELECT into temp table
PRINT 'Location 1'

-- Update temp table via loop
PRINT 'Location 2'

-- Sequentially loop through temp table and INSERT into temp2
PRINT 'Location 3'

...
[/pre]

When there is an error on the web page, instead of getting the actual error, we get the text of one of the PRINT statements, which is helpful for finding the problem, but not for letting us know what it is. It really came to light when it was only happening for a particular user due to that user's permissions.

I would like to see what the actual error message is. The location is nice, but the error is more important.

What do I need to fix?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top