Wednesday 29 October 2014

Parent Package Variables




      Using "Execute Package Task", we can call other SSIS packages in to current package.We can call the 'Current package' as 'Parent package', other calling packages we can call as 'Child packages'.

      Using 'Parent package variable'  we can call parent package variable value into child package.

Example:
      In this example i am going to explain how to call parent package variable value into child package.
  • Go to parent package and create required variable (Variable: Source_Path, DataType: String, Value: D:\Programs\files\SourceFile.txt).
 
  • Open Child package and create a variable (in this example i am creating variable with same name) with same data type (Variable: Source_Path, DataType: String).
  •  In Child package: Go to 'Control Flow' right click (don't select any task or container) and select 'Package Configurations'.
  • 'Package Configurations Organizer' window will open.
  • Select the 'Enable package configurations' check box and click on 'Add' button.
  • 'Package Configuration Wizard' will open.
  • From 'Configuration type' drop-down list select 'Parent package variable'.
  • Type Parent package variable name in the 'Parent variable' check box.
  • Click on "Next" button.
  • Select required variable value (to assign parent package variable value) .
  • Click on "Next" button
  •  Give 'Configuration name'.
  • Click on "Finish" button.
  • Close the "Package Configurations Organizer" window.
  • Save the package. During run time the parent package variable value will assign to child package.


No comments:

Post a Comment