Execute SQL Task - Cannot Add parameter

  • Hi all!

    I'm trying to insert a row in a table in my db through the sql task.

    The value to be inserted must be dynamic and thus taken from a variable. I made the query in this way:

    Insert into table_t (field) values (?)

    But....when I try to add a parameter in the Parameter Mapping page, the dialog closes....

    Where's my error?

    Thanks!

  • Hi,

    If you want to insert using an Execute SQL task you can use the 4th option EXPRESSIONS, and Use property

    SQLSTATEMENTSOURCE to write you insert query and use variables in it directly, It will work perfectly.

    something like this:

    "INSERT INTO [AUDIT] ( [ETL_Start_Time],[ETL_End_Time])

    VALUES ( '" + (DT_STR,40, 1252) @[User::v_TaskStartTime] +

    "','"+ (DT_STR, 40, 1252) @[User::v_TaskEndTime] +"')"

    hope this helps....:-)

    [font="Comic Sans MS"]
    ---------------------------------------------------

    Thanks [/font]

  • Expressions are more friendly in SSIS and is always the best option..

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

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