dtexec /set \package.variables

  • dtexec /f c:\SSIS\mypackage.dtsx /set \Package.Variables[User::SubFolder].Value;"XYZ"

    MYpackage.dtsx has a hardcoded subfolder="ABC" of type string.

    I expected the above dtexec to put the extract into subfolder XYZ. But it does not, it uses ABC and stores the extract there.

    What am I missing?

    I debug by putting message box and upon package entry, the subfolder is ABC which is hard coded in .dtsconfig file.

    Thanks

  • that dtexec works and passes XYZ to the package on my local sql server box. It does not pass XYZ on the sql server box -- must be some constraints or limitations set there. Thanks

  • You need to configure your DesinationConnectionFlatFile to use the variable.

    View the properties of the destination file connection manager. (F4 key, don't double-click)

    Set the 'connection string' property using the expressions property.

    May look something like: "\\\\MyRootFolder\\" + @[SubFolder] + "filename.txt"

  • Thanks! yes, I did have an expression with the folder variable. THe issue was the folder dynamic value was not passed to the SSIS package.

    I found out how to make it work -- keep the user variables in the SSIS package but do not have them in the .dtsconfig file. IN other words, if they are in the .dtsconfig file, the file precedence wins thus the old value remains while the dynamic value is unused....

  • MissyDaisy (7/3/2012)


    Thanks! yes, I did have an expression with the folder variable. THe issue was the folder dynamic value was not passed to the SSIS package.

    I found out how to make it work -- keep the user variables in the SSIS package but do not have them in the .dtsconfig file. IN other words, if they are in the .dtsconfig file, the file precedence wins thus the old value remains while the dynamic value is unused....

    Indeed. Package configurations can be tricky.

    They are applied in the following order:

    1. apply package configurations

    2. apply values from /SET clause

    3. re-apply package configurations

    Step 3 would overwrite your "XYZ" value.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Thank you for throwing some light. I was pulling my hair for an hour and so did our DBA.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply