Reputation: 565
I have a DTSX file that needs to have a parameterized query. The query occurs in the "DataFlowTask" here:
Which calls the data flow task here:
and the query:
The project builds - if I remove the parameter, it runs fine. However, I am having issues setting the parameter. I've tried probably a hundred combinations, including:
dtexec /f "D:\[location]\ExportOrdersWithParameter.dtsx" /set "\Package.Variables[OrderDate].Value";"1/1/2000"
dtexec /f "D:\[location]\ExportOrdersWithParameter.dtsx" /set "\Package.Variables[OrderDate].Value";"1/1/2000"
dtexec /f "D:\[location]\ExportOrdersWithParameter.dtsx" /set "\Package.Variables[User::OrderDate].Value";"1/1/2000"
dtexec /f "D:\[location]\ExportOrdersWithParameter.dtsx" /set "\Package.Variables[$Package::OrderDate].Value";"1/1/2000"
dtexec /f "D:\[location]\ExportOrdersWithParameter.dtsx" /set "\Package\DataFlowTask.Variables[$Package::OrderDate].Value";"1/1/2000"
dtexec /f "D:\[location]\ExportOrdersWithParameter.dtsx" /set "\Package\DataFlowTask.Variables[User::OrderDate].Value";"1/1/2000"
dtexec /f "D:\[location]\ExportOrdersWithParameter.dtsx" /set "\Package.Variables[OrderDate].Value;1/1/2000"
And all sorts of other combinations. There errors are a mix of "Process configuration failed to set the destination at the package path of ..." or "Package path referenced an object that cannot be found"
I'm totally lost - what am I missing?
Upvotes: 1
Views: 911
Reputation: 5246
As your screenshot shows that OrderDate
is a package Parameter, not a Variable. So, to pass it with dtexec, you need to call it this way
dtexec /f "D:\[location]\ExportOrdersWithParameter.dtsx" /Parameter
"$Package::OrderDate(DateTime)";2008-12-22
There might be issues on how your system parses DateTime values; perhaps, you better off specifying date as YYYYMMDD or YYYY-DD-MM.
Upvotes: 3