Using SSDT 16.0.61908, SSIS 15.0.2000 and VS Community 16.3.4
Inside a data flow that will be a predecessor to other flows, I have a simple OLE DB Source that runs an SQL query against a table in a DB that returns 4 columns:
- PAYGROUP
- PERIOD START
- PERIOD END
- CHECK DATE
When I execute the package, I want the package to compare the run date to the most recently completed CHECK DATE value and set the corresponding PAYGROUP, PERIOD START and PERIOD END values as variables to use in the subsequent flows.
I've tried using derived columns but even then I couldn't get the syntax right. Furthermore if I am able to deduce the most recent check date and correlated values, I'm also not sure how to pass it to a variable that's called in subsequent flows.
For this I would use an ExecuteSql task.
1) Set the resultset to single row
2) Use the bottom part of the query below to select the correct row
3) In the resultset, map the columns to variables