SSIS DTEXEC 包变量空格字符不接受

发布于 2024-09-11 20:41:42 字数 1071 浏览 4 评论 0原文

我正在尝试使用以下命令在 SQL 2005 上执行 SSIS 包:

dtexec /SQL "\MyPackageName" /SERVER mssql1 /MAXCONCURRENT " -1 " /CHECKPOINTING OFF
 /SET "\Package.Variables[FileFolder].Value";"\\SomeServer\Someshare\Output Batch\"

这会产生:

Option "Batch " is not valid.

引号内的 Batch 一词末尾的空格给了我一个提示,也许它正在将最后一个反斜杠视为转义字符。所以我尝试了这种方式:

dtexec /SQL "\MyPackageName" /SERVER mssql1 /MAXCONCURRENT " -1 " /CHECKPOINTING OFF
 /SET "\Package.Variables[FileFolder].Value";"\\\\SomeServer\\Someshare\\Output Batch\\"

这允许包运行,但是当这个变量用作要输出数据的平面文件的名称时,它现在给出以下错误:

Warning: 2010-07-27 14:36:38.23
   Code: 0x8007007B
   Source: Data Flow Task Flat File Destination [72]
   Description: The filename, directory name, or volume label syntax is incorrect.
End Warning
Error: 2010-07-27 14:36:38.23
   Code: 0xC020200E
   Source: Data Flow Task Flat File Destination [72]
   Description: Cannot open the datafile "\\\\SomeServer\\Someshare\\Output Batch\FlatFile.txt".
End Error

什么给出?

I'm attempting to execute an SSIS package on SQL 2005 using the following:

dtexec /SQL "\MyPackageName" /SERVER mssql1 /MAXCONCURRENT " -1 " /CHECKPOINTING OFF
 /SET "\Package.Variables[FileFolder].Value";"\\SomeServer\Someshare\Output Batch\"

this yields:

Option "Batch " is not valid.

The space at the end of the word Batch inside the quotes gave me a hint that perhaps it is treating the final backslash as an escape character. So I tried it this way:

dtexec /SQL "\MyPackageName" /SERVER mssql1 /MAXCONCURRENT " -1 " /CHECKPOINTING OFF
 /SET "\Package.Variables[FileFolder].Value";"\\\\SomeServer\\Someshare\\Output Batch\\"

This allowed the package to run, but when this variable is used as the name of a flatfile to output data to, it now gives the following error:

Warning: 2010-07-27 14:36:38.23
   Code: 0x8007007B
   Source: Data Flow Task Flat File Destination [72]
   Description: The filename, directory name, or volume label syntax is incorrect.
End Warning
Error: 2010-07-27 14:36:38.23
   Code: 0xC020200E
   Source: Data Flow Task Flat File Destination [72]
   Description: Cannot open the datafile "\\\\SomeServer\\Someshare\\Output Batch\FlatFile.txt".
End Error

What gives?

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

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

发布评论

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

评论(1

忘年祭陌 2024-09-18 20:41:42

在列出错误数据文件的错误消息中,“Batch”一词后面的单个反斜杠暗示可能只有该反斜杠受到影响。

一些测试证明,由于某种奇怪的原因,当包变量的最后一个字符需要是反斜杠时,SSIS 要求它加倍。即使使用 GUI 并选择“SQL Server Integration Services Package”类型的作业并单击“设置值”选项卡,这也适用:结尾的反斜杠必须加倍。

最终的工作命令是:

dtexec /SQL "\MyPackageName" /SERVER mssql1 /MAXCONCURRENT " -1 " /CHECKPOINTING OFF
 /SET "\Package.Variables[FileFolder].Value";"\\SomeServer\Someshare\Output Batch\\"

最后一个双反斜杠。

In the error message listing the erroring datafile, the single backslash after the word Batch gives the hint that perhaps only that backslash is affected.

Some testing proved out that for some strange reason, when the last character of a package variable needs to be a backslash, SSIS requires it to be doubled up. This applies even when using the GUI and choosing a job of type "SQL Server Integration Services Package" and clicking on the "Set values" tab: a trailing backslash has to be doubled up.

The final working command was:

dtexec /SQL "\MyPackageName" /SERVER mssql1 /MAXCONCURRENT " -1 " /CHECKPOINTING OFF
 /SET "\Package.Variables[FileFolder].Value";"\\SomeServer\Someshare\Output Batch\\"

With a final double-backslash.

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