using variable for inserting data into table inssis package

  • What error are you seeing?

  • Good practice dictates that you should name your target fields:

    insert into t_RowCount(f1, f2) ....

    Other than that, looks like it should work.


  • HI Tim,

    I'm receiving the following error

    exec(@sql)" failed with the following error: "Parameter name is unrecognized.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

    Task failed: Execute SQL Task

    Warning: 0x80019002 at RowCountUsingVB: The Execution method succeeded, but the number of errors raised (1) reached the maximum allowed (1); resulting in failure. This occurs when the number of errors reaches the number specified in MaximumErrorCount. Change the MaximumErrorCount or fix the errors.

    SSIS package "RowCountUsingVB.dtsx" finished: Failure.

  • Is the Resultset property of the Execute SQL task set to None?


  • yes the resultset property is set to none

  • You need to create an expression for the SQLStatementSource property

    Set the expression to equal:

    "insert into t_RowCount values('+Cast(" + @[User::MyVar] + " as varchar(10))+',getdate())"

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

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