I do a poor-man's debuging by placing this code at all points in my sproc
that I think could cause issues:
If @@error<>0
Begin
select @errormsg='error, something happened here'
goto errormsg
End
Each error string is unique to the poisiton of the code. I then define
errormsg lable so that I input the errormsg string, and the parameters passed
into the sproc, into a temp table that I output from when there are errors.
the best part of this is then you can add an error data field to your
report, blank of course when there are no errors, but when there are, you can
create another small table to hold the output of the error data. Just
remember to hide the table when error string is blank. this gives you all the
info you need when trying to debug sprocs behind report layers. Also gives
the users a warm fuzzy knowing that perhaps they entered an incorrect
paramter since they can see what they entered.
[quoted text, click to view] "Michael C" wrote:
>
> Is there any way to step through a stored procedure so I can see what is
> happening? I want to be able to step through like I do in VB so I can see
> what is happening at each line of code (and where its failing!). Thanks in
> advance.
>