使用DTExec抛出错误“set”的SSIS包执行无效

时间:2017-12-14 12:41:02

标签: sql-server-2014

请帮助我做错的地方,

E:\Program Files\Microsoft SQL Server\120\DTS\Binn>DTExec /F "D:\SSIS\Import\connection_manager.dtsx" /set "\Package.Variables[User::packagedir].Properties[Value]";"D:\SSIS\Import\\" /set "\Package.Variables[User::PRODDB_connectionstring].Properties[Value]";"Data Source=*********;Initial Catalog=PRODDB;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False;Application Name=SSIS;" > "C:\Users\PROD\Desktop\SSIS\log.txt"

获得以下错误:

  

参数   “” \ Package.Variables [用户:: PRODDB_connectionstring]的.properties [值];数据   源= *********;初始   Catalog = PRODDB; Provider = SQLNCLI11.1; Integrated Security = SSPI; Auto   Translate = False;应用程序名称= SSIS;“”用于选项“set”不是   有效的。

1 个答案:

答案 0 :(得分:1)

在字符串开始之前,您需要使用\封装字符串。然后你应该在参数之后写.Value

    @ECHO OFF
ECHO.
ECHO This is a batch file
ECHO.

DTEXEC.EXE /F "C:\Users\thoje\Documents\Visual Studio 2015\Projects\Integration Services Project8\Integration Services Project8\Package30.dtsx" /set \Package.Variables[User::packagedir].Value;\""D:\SSIS\Import\\"\" /set \Package.Variables[User::conn].Value;\""Data Source=EGC25199;Initial Catalog=LegOgSpass;Provider=SQLNCLI11.1;Integrated Security=SSPI;Auto Translate=False"\"
PAUSE
CLS