Expressions in the package configuration

  • I have a connection manager that is the destination of a flat file. I had to set up the usage type as CREATE FILE. I put in a generic name and then setup an expression for the ConnectionString that had the concatenated variables to create the file name, because the name needs to have a date embedded in it. I then setup a configuration file for the package and saw that there is a ConnectionString parameter for the connection manager but no Expressions parameter. I am trying to confirm that I can just put the expression code into the ConnectionString of the configuration. If this is not the case can you tell me what steps I need to take?

  • GoofyKC (1/19/2009)


    I have a connection manager that is the destination of a flat file. I had to set up the usage type as CREATE FILE. I put in a generic name and then setup an expression for the ConnectionString that had the concatenated variables to create the file name, because the name needs to have a date embedded in it. I then setup a configuration file for the package and saw that there is a ConnectionString parameter for the connection manager but no Expressions parameter. I am trying to confirm that I can just put the expression code into the ConnectionString of the configuration. If this is not the case can you tell me what steps I need to take?

    Create expression based on your variable(s) to setup your ConnectionString parameter.

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • Are you saying to put the formula I put in the Expression on the connection manager, into the ConnectionString parameter of the configuration? I tried that and the results are like the ConnectionString may (or may not) get changed but then the Expression gets applied. If I take out the Expression and just override the ConnectionString then I get a message stating that the filename specified in the connection was not valid. I can then put the expression back into the connection manager and the file will get created by what is in the Expression and not the ConnectionString from the configuration.

  • GoofyKC (1/21/2009)


    Are you saying to put the formula I put in the Expression on the connection manager, into the ConnectionString parameter of the configuration? I tried that and the results are like the ConnectionString may (or may not) get changed but then the Expression gets applied. If I take out the Expression and just override the ConnectionString then I get a message stating that the filename specified in the connection was not valid. I can then put the expression back into the connection manager and the file will get created by what is in the Expression and not the ConnectionString from the configuration.

    You have to put configuration for your variable. You cannot store configuration for expression or at least I don't have knowledge if it is possible. You can setup your expression to be based on the value of variable(s). You can then apply this expression to your ConnectionString Parameter.

    ---
    SSIS Tasks Components Scripts Services | http://www.cozyroc.com/

  • I use a script task when I need to change the name of an input or output file. In the script I change the connection string for the appropriate connection manager.



    Alvin Ramard
    Memphis PASS Chapter[/url]

    All my SSC forum answers come with a money back guarantee. If you didn't like the answer then I'll gladly refund what you paid for it.

    For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]

  • Thanks for the info. I was not familiar with using configurations for packages when I started this package. So I had variables for the destination files but then changed them to connection managers for ease of changes (I felt it was less intrusive to the package). I then needed to be able to calculate a file name and was introduced to Expressions. Now seeing that configurations make manipulation of the packages without having to physically touch the package so easy I am going back to the destination files just being a variable. Thanks again.

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

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