Question

I have a project parameter that sets the max amount of time it can run. I set the User::StopTime variable to DATEADD("mi", User::MaxRun, System::StartTime). Now, in the loop that reads a block of rows, I want to keep getting a block at a time until I'm out of rows or now is past User::StopTime. I see System var that give me the container start time, but what I need is the time now. Is there a way to get that without a script? Not a big deal, just curious.

Was it helpful?

Solution

I believe you're looking for GETDATE. That should get re-evaluated each time it's inspected vs a static value like @[System::StartTime]

I created a simple package with a Variable CurrentTime of type DateTime and set an Expression on it of GetDate()

enter image description here

I put a For Loop Container on there to count from 0 to 1000 and then inside that put a Script Task that simply printed the value of @[User::CurrentTime] to prove that yes, it's evaluated at every inspection and then ran it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top