March 4, 2010 at 4:24 am
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!
March 4, 2010 at 10:01 am
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....:-)
Thanks [/font]
March 4, 2010 at 10:53 am
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