如何通过命令行执行 dtsx 包 [英] How to execute dtsx packages through command line

查看:127
本文介绍了如何通过命令行执行 dtsx 包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我通过命令行执行 dtsx 包时,出现以下错误提示

1.The connection is not found,连接集合在没有找到特定的连接元素时抛出错误

2.无法解析包xxxxxxx"中对象的包路径.请验证包路径是否有效

3.包路径引用了一个无法找到的对象,当试图将包路径解析为一个无法找到的对象时会发生这种情况

但是当我通过商业智能开发工作室运行包时,这很好用.

解决方案

在我等待评论的答案时在这里进行猜测,通常当包在 BIDS 中运行良好但在命令行中不起作用时,我发现与 64/32 位不兼容有关.

您是否使用 Excel、Access 或其他任何使用 JET 驱动程序的工作表?这只适用于 32 位模式.

在 64 位操作系统上,默认情况下,当您创建新的 ODBC 连接时,您将在 32 位版本无法访问的 64 位命名空间中创建它?

您使用的是 Informix 还是 UDB/DB2 驱动程序?我只找到了 32 个版本.

从命令行运行包

dtexec 是用于运行 SSIS 包的命令行机制.它有 2 种适用于 64 位操作系统的版本,都被命名为 dtexec,并且通常在 Windows Path 环境变量中引用 32 位

在 64 位操作系统上,64 位的默认路径为 "c:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTExec.exe"

仍然在 64 位操作系统上,32 版本的路径将是 "c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe"

要运行位于 C:\Src\MyProject\MyProject 中的名为 FooBar.dtsx 的包,调用将是

"c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe"/file C:\Src\MyProject\MyProject\FooBar.dtsx

如果该包位于 MyProject 文件夹中的 SQL Server (DEVSQL01) 上,这将是运行相同包的调用.

"c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe"/SQL \MyProject\FooBar/SERVER DEVSQL01

编辑

要应用配置,您需要指定/CONF 选项

"c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe"/file C:\Src\MyProject\MyProject\FooBar.dtsx/CONF C:\FooBar.dtsConfig

查看您的评论,我们的用法之间的唯一区别是您将所有内容都用双引号括起来.尝试不使用前后引号.

when i execute dtsx package through command line i am triggered with the following error saying

1.The connection is not found , the error is thrown by connections collection when the specific connection element is not found

2.Cannot resolve package path to an object in the package "xxxxxxx".Verify that the package path is valid

3.The package path referenced an object that cannot be found , this occurs when an attempt is made to resolve a package path to an object that cannot be found

But this works fine when i run the package through Business Intelligence development studio.

解决方案

Taking a guess here while I wait on an answer to the comment, generally when a package runs fine in BIDS but doesn't work from the commandline, I find it's related to 64/32 bit incompatibility.

Are you using Excel, Access or anything else that under the sheets uses the JET driver? That only works in 32 bit mode.

On a 64 bit OS, by default when you create a new ODBC connection, you'll be creating it in the 64 bit namespace which the 32bit version won't be able to access?

Are you using Informix or UDB/DB2 drivers? I only ever found 32 versions of those.

Running a package from the command line

dtexec is the command line mechanism for running an SSIS package. It comes in 2 flavors for 64 bit OS, both are named dtexec and generally the 32 bit is referenced in the Windows Path environment variable

On a 64 bit OS, the default path to the 64 bit would be "c:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTExec.exe"

Still on 64 bit OS, the path to the 32 version would be "c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe"

To run a package named FooBar.dtsx that lives in C:\Src\MyProject\MyProject, invocation would be

"c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe" /file C:\Src\MyProject\MyProject\FooBar.dtsx

If that package lives on SQL Server (DEVSQL01) in the folder MyProject, this would be the call to run the same package.

"c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe" /SQL \MyProject\FooBar /SERVER DEVSQL01

Edit

To apply a configuration, you need to specify the /CONF option

"c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DTExec.exe" /file C:\Src\MyProject\MyProject\FooBar.dtsx /CONF C:\FooBar.dtsConfig

Looking at your comments, the only difference between our usage is you have wrapped everything in double quotes. Try it without the preceding and trailing quote.

这篇关于如何通过命令行执行 dtsx 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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