May 24, 2004 at 3:53 am
I have a DTS set up which checks the status of a process and sends an alert to a user if a certain condition is met.
Each run checks the condition against a global variable, and when complete, updates the global variable with the new value.
For example:
GV1 was preset to "SUCCESS", after very first run, set to the status at the time "FAIL". DTS package saved.
DTS runs.
Current Process status is "SUCCESS"
If Process status is not equal to GV1 - alert user.
Update GV1 with current status - and so on.
The problem being that GV1 doesn't retain the latest setting. According to BOL, a global variable will retain the setting at the last execution:
DTSGlobalVariables("PrevRun").Value = DTSGlobalVariables("JobName").Value
May 24, 2004 at 12:16 pm
BOL isn't very clear about this, but I believe it means that the package has to be saved during execution after the global variable is reset. I've never done it, but I think you'd use an ActiveX task and the package object model.
Greg
Greg
May 25, 2004 at 5:18 am
, thanks Greg.
Not quite sure how to go about that!
I'll give it a go, but in the meantime, if anyone has any examples, they would be gratefully received.
Thanks
May 25, 2004 at 8:22 am
Alternatively, you could write the value to a table and then query the table during DTS execution for the value. You would also be able to set the value at the end of execution based on the results obtained.
Just a thought.
May 25, 2004 at 8:30 am
Thanks Bellis
That is what I ended up doing!
I was just trying to keep everything tidy and not have to have an extra table holding this one value. It certainly was the easiest option though!
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply