Cant Find Error From Stored Procedure

  • We have a Stored Procedure that is executed from a VB Script on a remote server. There is no control on when these are run so we do have concurrent executions of the procedure.

    The Stored Procedure uses Temporary Tables and it executes other (sub) procedures. The sub procedures also use temporary tables.

    At times the procedure will fail (in one of the sub procedures) and we have no error message to indicate what caused the error. We log each step (by writing info to a table) so we know where it failed but we do not know why. It does not always fail in the same place but most often it is in a command that is using a temporary table. I will run fine with multiple processes running but when it does fail there is always more than one active. It appears to be some timing issue with the temp table usage?

    We have error handling in the procedure (SET@Error_Code = @@error) but it never makes it past the statement that failed.

    We cant get any info from the remote server VB Script so is there any way to locate the error generated by this type of failure?

    Any help would be appreciated. Thanks. CW.

  • Instead of @@Error, try using a try...catch block. It's a significantly better way to handle errors.

    Check out http://msdn.microsoft.com/en-us/library/ms175976.aspx

  • Thank You. We will give that a try.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply