SSIS 配置问题:不返回 SQL Server 表配置值

发布于 2024-10-05 06:29:49 字数 320 浏览 0 评论 0原文

这是在服务器故障上发布的,但回想起来,这可能不是它的最佳位置,所以我将其移至此处。

我有一个包在我的开发机器上运行良好,但在生产中(以及在另一个开发桌面上)配置似乎停止工作。我正在使用 SQL Server 表配置从表中提取值并填充变量。我的数据库连接字符串是在运行时传入的,因此应该在生产环境中注意这一点。没有错误,但未检索到该值并且变量保持空白(它实际上是一个路径,因此我得到一个找不到文件,因为路径为空)。

该软件包可以在我的机器上运行。它从表中检索正确的路径并按预期填充变量。为什么这在其他地方停止工作而没有错误是一个谜。除了配置向导首页上的复选框之外,是否有其他地方需要“打开”配置。

This was posted on server fault, but in retrospect that may not be the best spot for it, so I've moved it here.

I have a package that runs fine on my dev machine but in production (and also on another dev desktop) the Config seems to stop working. I'm using SQL Server Table configuration to pull a value from a table and populate a variable. My Database connection string is passed in at runtime so this should be taken care of in the production environment. There are no errors, but the value is not retrieved and the variable remains blank (it is actually a path, so I get a file not found as the path is blank).

The package works on my machine. It retrieves the correct path from the table and populates the variable as expected. Why this stops working with no error elsewhere is a mystery. Is there someplace that configuration needs to be 'switched on', apart from the checkbox on the front page of the config wizard.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

·深蓝 2024-10-12 06:29:49

尝试事件处理程序
1. 选择事件处理程序 OnVariableValueChanged
2. 在窗格中添加脚本任务
3.传入System::VariableName,System::VariableValue作为InputVariables
4. 将以下内容添加到代码中:

Public Sub Main()

    Dts.Events.FireInformation(0, "VariableChangedEventLog", "Variable " & Dts.Variables("System::VariableName").Value.ToString() & " Changed to:- " & Dts.Variables("System::VariableValue").Value.ToString(), "", 0, True)

    Dts.TaskResult = Dts.Results.Success
End Sub

这将打印出变量,并且至少会指示您是否将正确的值传递到包中。

我遇到的问题是,我的包收到了正确的配置文件,但没有将此值传递给我的子包。很可能会发布一个关于此的新帖子的链接。

Try Event Handlers
1. Select Event Handler OnVariableValueChanged
2. Add a script task to the pane
3. Pass in System::VariableName,System::VariableValue as InputVariables
4. Add the following to the code:

Public Sub Main()

    Dts.Events.FireInformation(0, "VariableChangedEventLog", "Variable " & Dts.Variables("System::VariableName").Value.ToString() & " Changed to:- " & Dts.Variables("System::VariableValue").Value.ToString(), "", 0, True)

    Dts.TaskResult = Dts.Results.Success
End Sub

This will print out the variables and will at least give you an indication of whether the correct values are passed into the package.

I have the problem that my package receives the correct configuration file, but then is not passing this value onto my child packages. May well post a link to a new post on this.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文