SSIS将平面文件路径作为命令行参数传递 [英] SSIS passing flat file paths as command line parameters

查看:94
本文介绍了SSIS将平面文件路径作为命令行参数传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ssis软件包,该软件包将两个平面文件和一个数据库表作为连接.我想通过将这3个连接作为命令行参数传递来从命令行运行ssis软件包.我应该怎么打电话?

I have an ssis package that takes two flat files and a database tables as connections. I want to run the ssis package from command line by passing these 3 connections as command line parameters. How should I call?

经过一些Google搜索,我发现如果我们使用DB作为连接,这就是方法.但是无法弄清楚如何为平面文件传递连接参数.

After some google search I found that if we are using a DB as connection, this is how to pass. But couldn't figure out how to pass connection parameters for flat files.

DTExec.exe /F "<packagepath> /set \package.connections[MyDB].properties[ServerName];SS2K8SV01_Prod

推荐答案

假设我有一个名为FFCM的平面文件连接管理器,我想将ConnectionString属性更新为C:\ ssisdata \ output \ B.txt

Assume I have a flat file connection manager called FFCM and I'd like to update the ConnectionString property to C:\ssisdata\output\B.txt

dtexec.exe 
/file Package2.dtsx 
/set 
\Package.Connections[FFCM].Properties[ConnectionString];C:\ssisdata\input\B.txt

这些是区分大小写的值,因此必须将连接管理器称为FFCM.如果有ffcm,则无法使用.

These are case sensitive values so the connection manager must be called FFCM. If there is a ffcm, this wouldn't work.

说实话,如果必须处理路径中的空格,重命名路径要比处理路径容易,但是我相信整个参数都需要用双引号引起来,而不仅仅是分号后的部分

If you have to deal with spaces in the path, honestly, it's easier to rename the path than to deal with it but I believe the entire argument needs be in double quotes, not just the portion after the semicolon

dtexec.exe 
/file Package2.dtsx 
/set 
\Package.Connections[FFCM].Properties[ConnectionString];C:\ssisdata\input\B.txt
/set 
\Package.Connections[FFCM2].Properties[ConnectionString];C:\ssisdata\input\BC.txt
/set 
\Package.Connections[MyDB].Properties[ServerName];localhost

如何确定/set之后的状态

默认情况下,F4将为您在SSIS编辑器中单击的内容打开属性"窗口.查找给定对象的PackagePath属性,该属性标识基本"路径.

How do I determine what the thing is after the /set

By default, F4 will bring up the Properties window for whatever you have clicked on in the SSIS editor. Look for the PackagePath property of a given object and that identifies the "base" path.

从那里,您将需要访问Expressions集合以标识要设置ConnectionString

From there, you will need to access the Expressions collection to identify the property you'd like to set ConnectionString

因此,我们将通过命令行将完整路径设置为

Thus making the full path we will SET via command line as

\Package.Connections[FFCM].Properties[ConnectionString]

这篇关于SSIS将平面文件路径作为命令行参数传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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