【问题标题】:using SSIS to copy a file使用 SSIS 复制文件
【发布时间】:2014-10-14 08:33:34
【问题描述】:

尝试运行任务以复制文件时,我收到以下消息:

TITLE: Package Validation Error
------------------------------

Package Validation Error

------------------------------
ADDITIONAL INFORMATION:

Error at File System Task: Failed to lock variable "C:\Users\agordon\amtu2\DocumentTransport\production\reports\ORDER18940610353.txt" 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 at File System Task [File System Task]: An error occurred with the following error message: "Failed to lock variable "C:\Users\agordon\amtu2\DocumentTransport\production\reports\ORDER18940610353.txt" 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 at File System Task: There were errors during task validation.

 (Microsoft.DataTransformationServices.VsIntegration)

------------------------------
BUTTONS:

OK
------------------------------

我的架构如下所示:

以下是失败组件的属性:

这是失败组件的表达式部分:

最后,这是我的参数:

我做错了什么?

我应该完全消除这个文件系统任务并用C#脚本任务替换它来复制文件吗?

我的流程有什么明显的问题吗?

我为图片的大小道歉,我认为 stackoverflow 会调整它们的大小。原件在这里:

http://screencast.com/t/PvjBHWWHQ8
http://screencast.com/t/JWfs2n2uD8mu
http://screencast.com/t/T68ttqHo
http://screencast.com/t/89KCF8B0qBd

【问题讨论】:

    标签: sql sql-server-2008 tsql ssis


    【解决方案1】:

    属性页面要求提供变量名,而您提供的是文件路径。您的 SSIS 包中是否有可以保存完全限定文件名的变量?

    【讨论】:

    • 在 BIDS 中,当点击设计图面,然后选择菜单项 'SSIS'->'Variables' 你是否定义了一个全局变量来保存这个完全限定的文件路径,或者你正在使用一个循环结构,您希望与目录中的所有文件进行交互,文件名将放置在变量中?如果要使用相同的硬编码文件名,请将 IsSourcePathVariable 设置为 false...
    • 再看一遍,您似乎期望参数变量@[$Package::OrderReportFileName] 保存文件路径。你能用它吗(见 URL screencast.com/t/JWfs2n2uD8mu
    • 顺便问一下,源和目标是同一个完全限定的文件名吗?你在做副本,对吧?
    【解决方案2】:

    您的 SourceVariable 属性(在屏幕截图 #2 中)应该引用您的变量名称,而不是变量的实际值。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-15
      相关资源
      最近更新 更多