Setting a Variable in a Foreach ADO Enumerator

Hi,

im using a Foreach ADO Enumerator in my SSIS Package, which iterate on a DataSet from a SQL Task.

I use the "Variable Mappings" on my Foreach Loop to retrieve the values into User-variables. But what i need is a way to combine a value from the DataSet with a User-variable and assign this new value to a new User-variable.

Anybody tried something like this?

Regards, Martin

[426 byte] By [MartinKloppJensen] at [2007-12-24]
# 1

You can do this without any problem in a script task

Accessing a recordset in a script task (Your ADO recordset):
http://blogs.conchango.com/jamiethomson/archive/2006/01/04/2540.aspx

Accessing the package variables in a script task:
http://msdn2.microsoft.com/en-us/library/microsoft.sqlserver.dts.runtime.variabledispenser.aspx
-> click on LockOneForRead-method link if you want to see an example for using only one package variable
->click on LockForRead-method link if you're going to use more than one package variable and want to see a code example

Tom

TomDeCort at 2007-10-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...
# 2
you can set value to your variable by using

Dts.Variables("User::abc").Value = (select abc from table1)

ManojVerma at 2007-10-8 > top of Msdn Tech,SQL Server,SQL Server Integration Services...

SQL Server

Site Classified