SSIS 包无法锁定变量“”对于读取访问,出现错误 0xC0010001“找不到变量”

发布于 2024-11-03 11:57:55 字数 733 浏览 3 评论 0原文

我正在创建一个 SSIS 包,将文件从源复制到目标,然后使用目标处的日期和时间戳对其进行重命名。

复制任务工作正常,但是当涉及到重命名包的一部分时,我收到以下错误。

SSIS 包“XYZ.dtsx”启动。 重命名复制文件时出现错误:0xC0014054:无法锁定变量“文件名”以进行读访问,错误为 0xC0010001“找不到变量。在执行以下操作期间尝试从容器上的变量集合中检索变量时,会发生这种情况包中,变量不存在。变量名称可能已更改或未创建变量。”。

错误:0xC002F304,重命名复制的文件,文件系统任务:发生错误,并显示以下错误消息:“无法锁定变量“文件名”以进行读访问,错误为 0xC0010001”“找不到变量。当在包执行期间尝试从容器上的变量集合中检索变量但该变量不存在时,就会发生这种情况。变量名称可能已更改或未创建变量。”。 ”。 重命名复制文件时出现错误:0xC0024107:任务验证期间出现错误。 警告:Copy_RenameAirtricityDB 处的 0x80019002:SSIS 警告代码 DTS_W_MAXIMUMERRORCOUNTREACHED。 Execution 方法成功,但引发的错误数 (5) 达到了允许的最大值 (1);导致失败。当错误数量达到 MaximumErrorCount 中指定的数量时,就会发生这种情况。更改 MaximumErrorCount 或修复错误。 SSIS 包“Copy_RenameAirtricityDB (1).dtsx”完成:失败。

I am creating a SSIS package to copy file from source to destination and then rename it with date and time stamp at destination.

Copy task is working fine but when it comes to rename part of the package I am getting following error.

SSIS package "XYZ.dtsx" starting.
Error: 0xC0014054 at Rename Copied File: Failed to lock variable "file name" for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".

Error: 0xC002F304 at Rename Copied File, File System Task: An error occurred with the following error message: "Failed to lock variable "file name " for read access with error 0xC0010001 "The variable cannot be found. This occurs when an attempt is made to retrieve a variable from the Variables collection on a container during execution of the package, and the variable is not there. The variable name may have changed or the variable is not being created.".
".
Error: 0xC0024107 at Rename Copied File: There were errors during task validation.
Warning: 0x80019002 at Copy_RenameAirtricityDB: SSIS Warning Code DTS_W_MAXIMUMERRORCOUNTREACHED. The Execution method succeeded, but the number of errors raised (5) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.
SSIS package "Copy_RenameAirtricityDB (1).dtsx" finished: Failure.

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

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

发布评论

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

评论(2

踏月而来 2024-11-10 11:57:55

移动文件并避免虚拟源和目标连接及表达式的直接方法是使用脚本任务:

System.IO.File.Move(Dts.Variables["User::SourceFileName"].Value,Dts.Variables["User::DestinationFileName"].Value);

A straight-forward way to move a file and to avoid the need for dummy source- and destination connections and expressions is to use a script task with:

System.IO.File.Move(Dts.Variables["User::SourceFileName"].Value,Dts.Variables["User::DestinationFileName"].Value);
留蓝 2024-11-10 11:57:55

我通过设置我的来源和来源解决了这个问题文件系统任务上的目标连接为“IsSourcePathVariable = False”。创建了两个新的(在我的例子中是平面文件)连接,并且连接字符串设置为等于我的变量。当传递给文件系统任务时,该变量似乎仅被视为文本字符串,而不是文件/文件夹位置

I resolved this by setting both my source & destination connections on the file system task to "IsSourcePathVariable = False". Two new (flat file, in my case) connections were created and the connection strings set equal to my variables. It seems the variable is seen only as a text string when passed to the file system task, rather than a file / folder location

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