Variable used as an expression and value is configured from config SQL table

  • Hello friends,

    I am trying to configure a value of a variable from configuration table but the value is not getting updated. I have used this variable (User::GetStoreList) as an expression in the Execute SQL statement. The output is mapped into another variable (User::StoreNo) in the result set. 
    What I am trying to achieve is to pass this variable as a filter into the source query which is used in the Data flow task. But somehow the variable User::GetStoreList is not overriding from configuration table instead by default it takes the package value.. The other variables are able to read the value from configuration table but they are not used as an expression. Is something to do with expression ? I mean if we use variable as an expression, won't it be override from config table?


    DECLARE @StoreList VARCHAR(8000)

        SELECT

            @StoreList = COALESCE(@StoreList + ',', '') + CAST(StoreID AS VARCHAR)

        FROM [dbo].[Store_Latest]

        WHERE
        AND StoreID > 0

        SELECT

            @StoreList AS StoreID


    Thanks,
    Charmer

  • Please add another screen shot with the Result Set node selected.
    Also, are you using an OLEDB or ADO connection?

    The absence of evidence is not evidence of absence.
    Martin Rees

    You can lead a horse to water, but a pencil must be lead.
    Stan Laurel

  • Hello Phil
    I am using OLEDB.  StoreNo variable is declared as String.


    The below screenshot is from config table. 

    Thanks,
    Charmer

  • Hello Phil,

    I have removed the SQL command from the expression instead used just a value. Now it works.

    Thanks,
    Charmer

Viewing 4 posts - 1 through 3 (of 3 total)

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