转SSIS 2012 pass values from child package to parent with project deployment model
2016-04-14 17:47
465 查看
http://stackoverflow.com/questions/20288766/ssis-2012-pass-values-from-child-package-to-parent-with-project-deployment-model
Parameter binding on the execute package task is currently a ONE way street Parent --> Child.
Here is a way to pass a value from a child package variable to a parent package variable.
Script Task: (in child package)
This code was actually from a pre-2012 SSIS Package that I just finished upgrading to SSIS for SQL Server 2012 (in Visual Studio 2012), and converted to project deployment model.
Initially, the execution died (after a lengthy delay) on the variable assignment line. But then I added the "User::" prefix, which apparently was necessary for at least one, but not all of the variables I was assigning this way. The prefix was not necessary in SSIS for SQL Server 2008.
Parameter binding on the execute package task is currently a ONE way street Parent --> Child.
Here is a way to pass a value from a child package variable to a parent package variable.
Script Task: (in child package)
// Populate collection of variables. // This will include parent package variables. Variables vars = null; Dts.VariableDispenser.GetVariables(ref vars); // Lock the to and from variables. Dts.VariableDispenser.LockForWrite("User::MyParentPackageVar"); Dts.VariableDispenser.LockForRead("User::MyChildPackageVar"); // Apparently need to call GetVariables again after locking them. // Not sure why - perhaps to get a clean post-lock set of values. Dts.VariableDispenser.GetVariables(ref vars); vars["User::MyParentPackageVar"].Value = vars["User::MyChildPackageVar"].Value; vars.Unlock();
This code was actually from a pre-2012 SSIS Package that I just finished upgrading to SSIS for SQL Server 2012 (in Visual Studio 2012), and converted to project deployment model.
Initially, the execution died (after a lengthy delay) on the variable assignment line. But then I added the "User::" prefix, which apparently was necessary for at least one, but not all of the variables I was assigning this way. The prefix was not necessary in SSIS for SQL Server 2008.
相关文章推荐
- [UIImageView sd_setImageWithURL:placeholderImage:]: unrecognized selector sent to instance
- 【转】工作队列(workqueue)
- 为什么要用Message Queue
- Longest Consecutive Sequence
- 创建UITextField对象
- SVN: 更新出错Description : The working copy is locked due to a previous error
- UIView的setNeedsDisplay和setNeedsLayout方法区别
- CUICatalog: Invalid asset name supplied:
- 使用uiautomatorviewer获取android apk的元素
- Tableview快速上手(方法注释到位哦)
- Queue、BlockingQueue以及用BlockingQueue实现生产者/消费者模式
- Android 消息机制 以及Message、Handler、Message Queue、Looper之间的关系。
- iOS UITabBar的隐藏显示
- UICollectionViewFlowLayout备忘录
- UIAutomator测试工具的配置以及使用
- 使用fuel6.0自动安装openstack-juno版本
- 问题:UIButton 添加倒计时功能后会一闪一闪
- Request对象
- UIAlertView' is deprecated: first deprecated in iOS 9.0 - UIAlertView is deprecated. Use UIAlert
- 淘宝封装的一款ui 非常不错