I have multiple SSIS projects, but some of the packages inside them are the same.
I would like to create a project with all the generic packages and keep the others projects with theirs specific packages.
So my question is : is it possible to have a master package that can execute and pass parent variables to packages from another project ?
I'm new to SSIS so sorry if it's an obvious question or if i'm not specific enough
The Execute Package task in SSIS allows us to call packages present in the Same Project, File system, and SQL Server.
When you configure an Integration Services catalog you can execute the packages from another project.
script
menu and select New query editor window
@execution_id
(not neccessary)DECLARE @var0 smallint = 1
line and replace @var0
with 1 (in the line it will be @parameter_value=1 )Now in your master package:
Execute SQL Task
OLE DB connection manage
r to SSISDB
database Execute SQL Task Editor
--> SQLstatement
: paste here the generated package scriptAn example of the script:
Declare @execution_id bigint
EXEC [SSISDB].[catalog].[create_execution] @package_name=N'testpackage.dtsx', @execution_id=@execution_id OUTPUT, @folder_name=N'TestFolder', @project_name=N'TestProject', @use32bitruntime=False, @reference_id=Null
Select @execution_id --delete this line
DECLARE @var0 smallint = 1 `-- delete this line`
EXEC [SSISDB].[catalog].[set_execution_parameter_value] @execution_id, @object_type=50, @parameter_name=N'LOGGING_LEVEL', @parameter_value=@var0 `--(replace this @var0 with 1)`
EXEC [SSISDB].[catalog].[start_execution] @execution_id
GO
Passing parameter: Add the following two line to add pass a paremeter
DECLARE @ReportDate nvarchar(100) = `?`
EXEC [SSISDB].[catalog].[set_execution_parameter_value] @execution_id, @object_type=30, @parameter_name=N'ReportDate', @parameter_value=@ReportDate
Now from "Parameter Mapping" tab on the Execute SQL Task Editor
add your variable you want to pass as a parameter.
Remember that variable data type has to be same as the parameter data type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With