From the course: Implementing a Data Warehouse with Microsoft SQL Server 2012

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Introduction to control flow

Introduction to control flow - SQL Server Tutorial

From the course: Implementing a Data Warehouse with Microsoft SQL Server 2012

Start my 1-month free trial

Introduction to control flow

In this section, I'd like to talk about controlling the flow of a SQL Server integration services package. When we work with control the flow, we are typically worried about two things. One, we like to have some sort of looping structure to allow a certain chunk of code to be executed more than once, and we'd also like some sort of decision structure, where we can conditionally execute a task or not execute it, based on the value of some variable. Let's talk about looping, first. I'm going to create a new project, and it would be an integration services project. Default name, default location, and here on the Control Flow surface, I'd like to look at the For Loop Container. Over here on the right, in the Toolbox, I have the For Loop Container. I'll drag one of those onto the Control Flow surface, and I'll need to set up some initial conditions about the For Loop. In doing that, I'm going to need a variable, and in this case, I'm just going to create a variable called x. You first need…

Contents