不接受SSIS DTEXEC程序包变量空间字符 [英] SSIS DTEXEC Package Variable Space Character Not Accepted

查看:90
本文介绍了不接受SSIS DTEXEC程序包变量空间字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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\"

这将产生:

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

有什么作用?

推荐答案

在列出错误数据文件的错误消息中,批处理"一词后的单个反斜杠表示可能仅反斜杠受到了影响.

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.

一些测试证明,出于某些奇怪的原因,当包变量的最后一个字符需要为反斜杠时,SSIS要求将其加倍.即使在使用GUI并选择"SQL Server Integration Services程序包"类型的作业并单击设置值"选项卡时,这也适用:必须将尾随反斜杠加倍.

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.

最后的工作命令是:

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

最后加两个反斜杠.

这篇关于不接受SSIS DTEXEC程序包变量空间字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆