In my previous post, I have explained how to create reusable SSIS Template in SSIS packages. If you haven’t read, I strongly recommend to go through SSIS – Flat File Package Logger – Part 1
Today’s post is all about
- Package parts variables and its scope
- How to use SSIS reusable templates in actual SSIS packages ?
- How to pass values to the package parts ?
Package parts variables and its scope
Would you like to develop your package part more dynamic / configurable?
Go for using “variables” in the package parts. It will act like input and output parameter.
Scope of the Variable’s are lies within the package part. so that it could act like a parameter between package and package parts
How to use the SSIS reusable templates in actual SSIS packages ?
If you see the below screenshot, Test DFT “Data flow task” is just a component which will be used in the package. “PackageLogger” is the package part which is reused (right top icon ‘P’ shows that , it belongs from package parts). After the execution of DFT, then the package logger helps to log the package status in Flat File.
How to pass values to the package parts ?
If you have seen my previous post, I have used variables in my package parts. so that my package parts will be more dynamic and have more options for configuring it.
Check the below diagram and its variables. We could clearly see the variable scopes
As i mentioned earlier, variables in the package parts are acts like a parameter to the package parts. So it will not be available to assign values in the execution of other components.
Row counts are need to pass to the package parts rite. Add variables as required for it. we have added the required variables in the package, then what ?
how to pass this value to package parts parameter?
I hope you would have guessed, yes that’s correct. “Variable Expression“
Using variable expression, we can pass row count details to the package logger. Configure like below
After successful execution
Hope you got clear picture on using the package parts in packages and passing values to it. I have shared an idea of how to use this. It can be modified or changed as per our business requirement.
I am so happy to help you out if required. Try it out and let me know your thoughts on it.