June 12, 2015 at 4:49 pm
I have the following dtexec command that works fine in a cmd batch file:
dtexec /f %DTSPackagesDir%"\%SSISJob%" /Decrypt %DTSPassword% /CONN cm_sql_USTG;%cm_sql_USTG% /Reporting E /Set \Package.Variables[User::strDestinationFolderForFlatFile].Value;%TargetDir%\ /Set \Package.Variables[User::strExtractType].Value;%ExtractType% /Set \Package.Variables[User::strDayKey].Value;%ProcDate%
I tried converting it for Powershell and ended up with this:
dtexec /f "$cfgDTSPackagesDir\$DTSPackageName /Decrypt $cfgDTSPassword /CONN cm_sql_USTG;$cm_sql_USTG /Reporting E /Set \Package.Variables[User::strDestinationFolderForFlatFile].Value;$TargetDir\ /Set \Package.Variables[User::strExtractType].Value;$ExtractType /Set \Package.Variables[User::strDayKey].Value;$DayKey"
The connection string is:
Set-Variable -name cm_sql_ustg "Data Source=$cfgDBServer;Initial Catalog=$cfgDBName;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;Application Name=$AppName"; Write-Output "Connection String cm_sql_ustg: $cm_sql_ustg"
I am either getting that the "system cannot find the file specified" and I know it is there, or if I make some changes, it stops on the connection string, not recognizing "Source" (as part of the "Data Source ...." string.
Thanks for any help.
June 12, 2015 at 5:09 pm
dcwilson2009 (6/12/2015)
I tried converting it for Powershell ...
If the batch file was working, then I have to ask... WHY?
--Jeff Moden
Change is inevitable... Change for the better is not.
June 13, 2015 at 3:16 pm
I have seen PowerShell get confused when calling external commands with lots of parameters. In that case you might have to call start-process with dtexec and specify each of the arguments in the -argumentlist parameter
Joie Andrew
"Since 1982"
June 23, 2015 at 1:00 am
Sorry. I have been unavailable. Did you resolve this?
Gaz
-- Stop your grinnin' and drop your linen...they're everywhere!!!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply