Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pass dynamic value to ssis package

Status
Not open for further replies.

scottcabral1979

Programmer
Mar 16, 2012
30
0
0
US
I have an SSIS package that has a variable called @RUN_DATE.

I would like to create a sql agent job and uses the set values tab to pass a dynamic parameter to the ssis package.

for example, i would like to always set the variable to the last day of the previous month. I know that If i hardcode the date as 5-31-2013 it works fine, but i have not been able to figure out how to make the value dynamic by using an expression or if this is even possible.

any help would be appreciated.

thanks
Scott
 
Rather than try to have the SQL Agent pass a paramter, perhaps you could add either an Execute SQL Task to your package and have it use:

Code:
SELECT DATEADD(MS, -3, DATEADD(MM, DATEDIFF(MM, 0, GETDATE()), 0))

to populate your run date with the last day of the previous month, or use a Script Task to have VB/C# do a similar thing to load the variable with the desired date.

Hope I have understood your requirement properly.

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top