Setting Parameters in SSIS at Run time

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
GO

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s