September 4, 2014 at 2:29 pm
In SSIS I have a variable which is evaluated as an expression and it returns seconds (along with date) to name a file.
I name the file and save it, then around 10 seconds later when the last control flow has finished it sends an email with a link to where that file is stored.
By that time ~10 seconds have passed so when the variable is referenced again it has a new value for the seconds (or possibly even minutes).
How can I get my variable to only evaluate once and maintain that same value through the entire execution of the package?
If my package starts at 8:00:00 AM and ends at 8:01:15 AM I still want that original 8:00:00 AM value to reference later.
September 4, 2014 at 3:30 pm
Quick thought, but I'm not an SSIS expert.
You could assign the value to your variable through a Script task instead of an expression. That way, you'll keep the same value during the entire execution.
September 4, 2014 at 6:07 pm
Yep and that works but feels so wrong 🙂
September 5, 2014 at 1:13 am
There is an SSIS System Variable called 'StartTime'.
You may be able to create an Expression which uses this, thus avoiding the need for a Script Task.
The absence of evidence is not evidence of absence.
Martin Rees
You can lead a horse to water, but a pencil must be lead.
Stan Laurel
September 5, 2014 at 1:17 am
Phil Parkin (9/5/2014)
There is an SSIS System Variable called 'StartTime'.You may be able to create an Expression which uses this, thus avoiding the need for a Script Task.
+1
The system variables are there for exactly this purpose.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply