0

I have a package SSIS for a company . Now I need to repeat the same work for 30 companies .

Company name

[Montreal$G_L_ entry]

[Dubai$G_L_ entry]

I would like like to loop over all companies . I get all the company names and put them in an ado record set. e.g.: SELECT DISTINCT CompanyName FROM YourTable in an execute sql task. create an ssis variable to hold the recordset .

How to make table name dynamic , I mean companyname$G_L_ entry and companyname will be changed dynamically ?

  • In a Foreach Loop Container, you'll need to extract values from that ADO.NET resultset into SSIS Variables. You will need to add an SSIS Variable to store your query. Put an Expression on that variable so that it looks like `SELECT Col1 FROM dbo." + @[User::CurrentTableName];` – billinkc Apr 23 '15 at 15:58

1 Answers1

0

You need to use a Foreach container to iterate through the variable that holds the ADO recordset. That will assign each company name to a variable once each time through the loop. In the body of the loop container you do whatever tasks you want and us that variable as a parameter to the tasks.