Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server 2005 - SSIS - Looping Through Recordset and retrieving data

Status
Not open for further replies.

ReportDr00

IS-IT--Management
Mar 2, 2007
194
US

Hello

I have created a data flow task and used OLE DB source to connect to sql server that queries the table and returns last name, first name, date birth and gender and i saved it into recordset destination

Now i added ForEach Loop with ADO Enumerator and did all the mappings

And with in the for loop i would like to query another database on different sql server taking the values from the recordset as parameter to this query (in this last name, first name, date birth and gender) and this query returns count(*) and client id and i set this as single row result set and captured the value into two different variables one is NumRecs and other is ClientID

Now i would like to see if NumRecs >0 and ClientID <> "" then query another database on different server to get information like service data, service type and service name.

I dont know how to do the above comparison in SSIS to see if NumRecs>0 and ClientID<>"" then do next sql task otherwise continue the loop of recordset.

Any ideas will be appreciated greatly

Armani
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top