Parameterized expression in a variable

  • i want to execute a stored which takes a parameter.

    i am using a SSIS variable and passing it to the query through a variable expression.

    Could you please let me know how do i put a parameter in a query?

  • using a parameter in a query using ssis is fairly simple.

    For every place you want a parameter use a ? in place of a variable name.

    The variables are used in order that you have them in your query.

    For example

    Select Mycol1, MyCol2

    FROM MyTable

    Where MyCol3 between ? and ?

    This uses 2 parameters.

    On your execute sql task select Parameter Mapping.

    and add a new Variable for every ? in your query. SSIS Evaluates these by ordinal,

    Meaning Parameter 0 is the first ? and Parameter 1 is the second?

    On a side note Change the name of the Parameter to be just 0. and 1 Respectively

    If I have Confused you

    Check this page out.

    http://www.sqlis.com/post/The-Execute-SQL-Task.aspx

Viewing 2 posts - 1 through 1 (of 1 total)

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