December 14, 2001 at 10:01 am
I have placed a VB script in a job and was curious on what I can use to return a value to the job to let it know if it was successful or not.
To test out the features I added a script that looks for a file, and if found msgbox back found, but it seems the Job functionality is not dynamic to the client to give a return. Any thoughts. -Jay
-JG
December 14, 2001 at 10:05 am
December 14, 2001 at 10:10 am
I embedded the code in the Enterprise Manager>>Management>>SQL Server Agent>> Jobs.
In the graphical tool I added a step and choose ActiveX Script in step type, and the radio btn VB.
I am using SQ 7.0 I am running the client utilities on Win2K.
-JG
December 14, 2001 at 11:12 am
The only way I've seen is to use the 'print' statement in the script - it will write out whatever you 'print' to the job history. Useful, sorta. If you want to pass a parameter, use a table or a file that you reference in the previous/next step. Avoid msgbox in script - you can wind up with a job that is hung up - the message box will pop but it is hidden, no way to click it.
Andy
December 14, 2001 at 11:17 am
December 14, 2001 at 12:20 pm
I am trying to get the Job to error out if the file is not present. Then I can attempt the retry in the advance tab. I Used Print, but the job simply succeeded.
-JG
December 14, 2001 at 2:25 pm
You can fail the package and this will a failed job message to the sqljob.
In the ActiveX script, there has to be a setting to mark the script as failed. There are a couple options in the DMO section. Perhpas try one of those.
Steve Jones
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply