In SSIS when you are running a package with a parameter I find myself wanting to set the Project Parameters at run time. You can do this by creating an Enviroment Variable and then running the below script to set it’s value. The Project Parameter is named LoadDate and this script is setting it to yesterday’s date.
DECLARE @var DATETIME =CONVERT(DATE,DATEADD( DAY, -1 , Getutcdate()))
EXEC [SSISDB].[catalog].[set_environment_variable_value] @variable_name=N’LoadDate’,
@environment_name=N’EDWSettings’, @folder_name=N’PaySpanEDW_Sources’, @value=@var