Home All Groups Group Topic Archive Search About

Throwing Errors In VB Script From SQL Job

Author
20 Jan 2006 4:57 PM
Doug
Hi,
  I am creating a SQL Job and using a VB Script inside of it.  In the
script, under certain conditions I throw an error.
  When I test the script under those conditions, I get notification the
error occurred, but not what the specific error is.  With TSQL commands
inside a job, it allows you to append information like that into a
file, but with VB Scripts it doesn't.
  Is there some other way to get what the error is when it occurs?  I
could write functionality in the VB Script to create a file and log to
it, but wanted to see if something easier was out there.

Author
23 Jan 2006 5:00 PM
Mary Chipman [MSFT]
One way is to wrap all database calls inside of stored procedures. You
then use T-SQL error handling to catch any errors, returning the
results to your app via output parameters, result sets, or return
statements, etc. That way your code can branch according to the
results returned.

--Mary

Show quote
On 20 Jan 2006 08:57:05 -0800, "Doug" <dnlwh***@dtgnet.com> wrote:

>Hi,
>  I am creating a SQL Job and using a VB Script inside of it.  In the
>script, under certain conditions I throw an error.
>  When I test the script under those conditions, I get notification the
>error occurred, but not what the specific error is.  With TSQL commands
>inside a job, it allows you to append information like that into a
>file, but with VB Scripts it doesn't.
>  Is there some other way to get what the error is when it occurs?  I
>could write functionality in the VB Script to create a file and log to
>it, but wanted to see if something easier was out there.

AddThis Social Bookmark Button