locked
Update the Value of Variable RRS feed

  • Question

  • Hi Experts ,

    We are using SSIS 2008 . A variable abc has been defined with sql script Select firstName,LastName from Employee.

    I need to edit the variable and add a where condition like SELECT firstName,lastName FROM employee where Name like '%Fr%' I tried to replace it with new script and saved also but when i ran the package it was still using the old sql script .

    Kindly tell me step by step as am a newbie how can i solve the above requirement .

    Thanks

    Priya

    Monday, April 20, 2015 10:07 PM

Answers

  • Hi ,

    The reason is because value is set on Expression .

    So what you can do is ;

    1. Go TO variable Tab -> Expression

    2. Type your Expression in Quotes -> OK

    "SELECT firstName,lastName FROM employee where Name like '%Fr%"

    Thanks


    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

    • Marked as answer by Priya Bange Tuesday, April 21, 2015 7:45 PM
    Tuesday, April 21, 2015 4:49 AM
  • There can be two reasons why this happens

    1. The variable value is set by means of an expression. You can check this by looking at EvaluateAsExpression property for the variable. If its yes then the value is calculated dynamically. In that case you should edit the expression (just click ellipsis next to Expression property to open expression builder for this) and modify it to include your new condition.

    2. The variable value is getting manipulated using configuration (parameters in SSIS 2012). You can check this by right clicking on package and choosing configurations options (parameters in 2012) and see if this variable is included. If yes you need to change value set at source ie configuration file or table entry depending on configuration option used or environment variable in case of parameters in SSIS 2012


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    • Proposed as answer by Katherine Xiong Tuesday, April 21, 2015 8:34 AM
    • Marked as answer by Priya Bange Tuesday, April 21, 2015 7:44 PM
    Tuesday, April 21, 2015 5:00 AM

All replies

  • Where did you try and change it? Is it a static statement you are trying to change and are you sure it isn't being set dynamically anywhere within the package?
    Monday, April 20, 2015 11:26 PM
  • Hi ,

    The reason is because value is set on Expression .

    So what you can do is ;

    1. Go TO variable Tab -> Expression

    2. Type your Expression in Quotes -> OK

    "SELECT firstName,lastName FROM employee where Name like '%Fr%"

    Thanks


    Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com

    • Marked as answer by Priya Bange Tuesday, April 21, 2015 7:45 PM
    Tuesday, April 21, 2015 4:49 AM
  • There can be two reasons why this happens

    1. The variable value is set by means of an expression. You can check this by looking at EvaluateAsExpression property for the variable. If its yes then the value is calculated dynamically. In that case you should edit the expression (just click ellipsis next to Expression property to open expression builder for this) and modify it to include your new condition.

    2. The variable value is getting manipulated using configuration (parameters in SSIS 2012). You can check this by right clicking on package and choosing configurations options (parameters in 2012) and see if this variable is included. If yes you need to change value set at source ie configuration file or table entry depending on configuration option used or environment variable in case of parameters in SSIS 2012


    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    ----------------------------
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

    • Proposed as answer by Katherine Xiong Tuesday, April 21, 2015 8:34 AM
    • Marked as answer by Priya Bange Tuesday, April 21, 2015 7:44 PM
    Tuesday, April 21, 2015 5:00 AM