SSIS 包变量
我有一堆不同的变量,大多数是字符串,但我有一个是整数。我需要从表中获取这个 int(它也是 INT 类型)。我的问题是设置这个变量的参数。我的所有其他变量(字符串)我都可以使用 {0}、{1}、{2}.. 等参数,但是 Int32 变量不允许我给它一个作为参数的值,我该如何处理?
I have a bunch of different variables, most are strings, however I have one which is an integer. I need to grab this int from a table (where it is also of type INT). My problem is with setting the parameter for this variable. All my other variables (which are strings) i can use parameters like {0}, {1}, {2}..etc however Int32 Variables will not let me give it a value which is a parameter, how do I handle this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我们将变量存储在配置表中,这样它们就可以在运行时从该服务器的配置中设置。我们有时也会运行父子 pacakgae,因此对于运行同一进程的不同客户端,变量可能会有所不同。然后,变量从父包变量中的父包传递到子包。
或者,您可以在进程开始时运行执行 SQL 任务以从表中获取值并将其设置为结果集中的 int 变量。如果变量会随着时间的推移而变化,因此您不希望它成为配置的一部分,这通常是最好的方法。
We store variables in a configuration table and that way they are set at run-time from the configuration for that server. We also sometimes run parent child pacakgae so the varaible can be differnt for differnt clients running the same process. Then the varaible is passed to the child paackge from the parent package in a parant package varaible.
Alternatively, you can run an execute SQL task at the start of the process to grab the value from the table and set it to the int variable in the result set. This is often the best way if the variable will change over time and thus you don't want it to be part of the configuration.