Wednesday, March 28, 2012

How to translate into SSIS?

Hi everyone,

My current dutie is translate Vb code into SSIS. The following structure is getting me totally crazy:

sql = "SELECT * FROM TABLE1 WHERE FIELD = XXXX"

rs.execute sql

WHILE NOT RS.EOF

STUFF

ANOTHER SELECT AND ANOTHER LOOP

...

...

INSERT AND DELETE STUFF

END WHILE

Which is the best method in order to reach this goal? I'm trying to by means of OLEDB Source Editor connected to Script Component Task on data flow layer but I'm stuck with this.

I don't want to do cursors or something like that with T-SQL.

Thanks in advance for your inputs/help and regards,

Could you use nested FOREACH containers? Store your initial resultset in a variable, then iterate through that, executing the second SQL statement, storing the results in a variable, and using a second FOREACH to iterate that.|||

hi,

using ForEach Loop container on control flow, you mean?

should I use ForEach ADO enumerator, shouldn't?

tia

|||Yes, control flow. Yes, ADO recordset.|||Thank you. I'll test it|||

It's easier than I though. I'll use a Script Task on Control Flow task. Just that task,

I don't need nothing else

|||Could you share the script? Stripped of anything specific to your business, of course.

No comments:

Post a Comment