PowerShell DTexec/ISServer将连接字符串作为包变量传递
问题描述:
我想通过PowerShell在ISServer上执行SSIS包。 我使用了微软页面上找到的脚本。这不适合我。 我想传递一个连接字符串,但不能分配给连接管理器,而只是作为一个变量字符串。在连接字符串中有\
;目前和PowerShell将此视为一种新选择。我只是希望它被看作是一个完整的字符串。PowerShell DTexec/ISServer将连接字符串作为包变量传递
我用尽了一切办法,增加"\"
和\""
像一些网站建议,使用instead of \, put double quotes, put ' quotes, nothing works. Always getting the error option
的MyServer \ MyServer的;Initial is not valid. I can't remove
MyServer的\ MyServer`因为连接到该实例。
Connectionstring通过变量变量赋值。所以变量包含Data Source=MyServer\Myserver;Initial Catalog=SQL_MyArchive;Provider=SQLNCLI11;Integrated Security=SSPI;
dtexec /ISSERVER "\SSISDB\Test\Test.dtsx" /SERVER "MYServer" /ENVREFERENCE 8 /Par "$Package::ConnectionSource";`""Data Source=MyServer\Myserver;Initial Catalog=SQL_MyArchive;Provider=SQLNCLI11;Integrated Security=SSPI;"`"
我怎样才能让系统看到整个的ConnectionString作为一个字符串? "" and "
“不工作。
答
使用以下语法到的ConnectionString传递给一个变量(你错过了\"
)
/Par "$Package::ConnectionSource";\""Data Source=MyServer\Myserver;Initial Catalog=SQL_MyArchive;Provider=SQLNCLI11.1;Integrated Security=SSPI;"\"