SSIS DTEXEC 包变量空格字符不接受
我正在尝试使用以下命令在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在列出错误数据文件的错误消息中,“Batch”一词后面的单个反斜杠暗示可能只有该反斜杠受到影响。
一些测试证明,由于某种奇怪的原因,当包变量的最后一个字符需要是反斜杠时,SSIS 要求它加倍。即使使用 GUI 并选择“SQL Server Integration Services Package”类型的作业并单击“设置值”选项卡,这也适用:结尾的反斜杠必须加倍。
最终的工作命令是:
最后一个双反斜杠。
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:
With a final double-backslash.