如何在 ssis 脚本组件中使用读写变量? [英] How can use read and write variable in ssis script component?

查看:35
本文介绍了如何在 ssis 脚本组件中使用读写变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 ssis 的新手,想将读写变量传递给脚本组件,为此,在脚本编辑器窗口中定义变量:

并在脚本中编写此代码以供使用:

但是当运行该数据流时,我收到此错误:

I'm new in ssis and want to pass read and write variable to the script component,for that purpose, define variable in script editor windows:

and in the script write this code for use that:

but when run that data flow,i get this error:


我该如何解决这个问题?在网上搜索我什么都不懂.谢谢大家.


How can i solve that problem?search on the web i did not understand anything.thanks all.

推荐答案

这意味着您只能在 PostExecute 方法中使用 ReadWriteVariables 中的变量,例如,保存你的计数器值.如果您需要在 PostExecute 方法之前读取此变量,您可以将其指定为 ReadOnlyVariables.警告 - 您只能选择其中一个系列,而不能同时选择两个系列.这是微软设计的.
如果您需要在 PostExecute 之前获得对读写变量的读访问权限,您可以调用 VariableDispenser 如上所述这里.但在这种情况下,您必须从 ReadOnlyVariablesReadWriteVariables 列表中排除这个变量.

That means that you can use variables from ReadWriteVariables only at PostExecute method, for example, to save your counter value. If you need to read this variable before PostExecute method, you can specify it as ReadOnlyVariables. Caveat - you can choose only one of the collections, not both. This is by Microsoft design.
If you need to have read access to a read-write variable earlier that PostExecute, you can call VariableDispenser as described here. But in this case you have to exclude this variable from both ReadOnlyVariables and ReadWriteVariables lists.

这篇关于如何在 ssis 脚本组件中使用读写变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆