0% found this document useful (0 votes)
30 views2 pages

Lesson 2: Adding Looping: Important

This document discusses adding looping functionality to an ETL package in SQL Server 2016 Integration Services. It introduces the Foreach Loop container and For Loop container as two options for adding iteration or looping to packages. The Foreach Loop container uses an enumerator to loop through items like files, records, variables, while the For Loop container uses a variable expression. This lesson focuses on using the Foreach Loop container to modify a package from Lesson 1 to extract data from multiple flat file sources instead of a single file.

Uploaded by

biplobusa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

Lesson 2: Adding Looping: Important

This document discusses adding looping functionality to an ETL package in SQL Server 2016 Integration Services. It introduces the Foreach Loop container and For Loop container as two options for adding iteration or looping to packages. The Foreach Loop container uses an enumerator to loop through items like files, records, variables, while the For Loop container uses a variable expression. This lesson focuses on using the Foreach Loop container to modify a package from Lesson 1 to extract data from multiple flat file sources instead of a single file.

Uploaded by

biplobusa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Lesson 2: Adding Looping

SQL Server 2016


Other Versions

Applies To: SQL Server 2016 Preview


In Lesson 1: Creating the Project and Basic Package, you created a package that extracted data from a single flat file source, transformed the
data using Lookup transformations, and finally loaded the data into the FactCurrency fact table of theAdventureWorksDW2012 sample
database.
However, it is rare for an extract, transform, and load (ETL) process to use a single flat file. A typical ETL process would extract data from
multiple flat file sources. Extracting data from multiple sources requires an iterative control flow. One of the most anticipated features of
Microsoft Integration Services is the ability to easily add iteration or looping to packages.
Integration Services provides two types of containers for looping through packages: the Foreach Loop container and the For Loop container.
The Foreach Loop container uses an enumerator to perform the looping, whereas the For Loop container typically uses a variable expression.
This lesson uses the Foreach Loop container.
The Foreach Loop container enables a package to repeat the control flow for each member of a specified enumerator. With the Foreach Loop
container, you can enumerate:

ADO recordset rows

ADO .Net schema information

File and directory structures

System, package and user variables

Enumerable objects contained in a variable

Items in a collection

Nodes in an XML Path Language (XPath) expression

SQL Server Management Objects (SMO)

In this lesson, you will modify the simple ETL package created in Lesson 1 to take advantage of the Foreach Loop container. You will also set
user-defined package variables to enable the tutorial package to iterate through all the flat files in the folder. If you have not completed the
previous lesson, you can also copy the completed Lesson 1 package that is included with the tutorial.
In this lesson, you will not modify the data flow, only the control flow.

Important

This tutorial requires the AdventureWorksDW2012 sample database. For more information
about how to install and deployAdventureWorksDW2012, see Reporting Services Product
Samples on CodePlex.
Lesson Tasks
This lesson contains the following tasks:

Step 1: Copying the Lesson 1 Package

Step 2: Adding and Configuring the Foreach Loop Container

Step 3: Modifying the Flat File Connection Manager

Step 4: Testing the Lesson 2 Tutorial Package

You might also like