Learn your way! Get started

SSIS 2014, Part 06 of 11: Variables and Expressions

with expert Don Kiely


Watch trailer


Course at a glance

Included in these subscriptions:

  • Dev & IT Pro Video
  • Dev & IT Pro Power Pack

Release date 11/3/2014
Level Intermediate
Runtime 1h 55m
Closed captioning Included
Transcript Included
eBooks / courseware Included
Hands-on labs Included
Sample code Included
Exams Included


Enterprise Solutions

Need reporting, custom learning tracks, or SCORM? Learn More



Course description

Integration Services variables are similar to those in your favorite programming language but they work differently in Integration Services packages. Because most of the time you aren’t writing code that can directly manipulate variables. Instead you use them to set the value of properties as part of an expression or in a script component where you write VB or C# code. They are enormously useful for sharing data throughout a package including the reuse of expressions and you can use them in almost any Integration Services object such as connection managers, control flow tasks and data flow transformations. In this course you’ll learn what you need to know to use variables and expressions. We’ll start off by exploring just what a variable is in Integration Services and how it has special properties, as well as a bit of the data types available. You’ll also see where and how you can use variables, which as it turn out is in nearly every nook and cannery of a package. Then we’ll explore how to use variables in control and data flows in a package. You’ll also learn about the important property expressions feature, which lets you use variables to set values of package component properties. You’ll begin to understand how variables can make packages amazingly dynamic, responding to data characteristics, the external environment, or just about anything else you can write in code. Next we’ll explore Integration Services Expression. Expressions are the single most important feature for creating dynamic packages that are able to modify what they do based upon almost any kind of state or environmental factor. What makes expressions particularly powerful in packages is that you can imbed them directly into the various properties of just about any object in the package or in a variable for reuse through that variables scope. Variables and expressions aren’t quite the same thing as they are in your favorite programming language but they are dynamic in nature and the ability to let you share information between components is pure gold.

Prerequisites

This course assumes that you have a basic familiarity with the concept of relational databases and a basic understanding of what SQL Server is and the high-level tools in it, as well as how to create and manage objects using Management Studio. You should also have a basic understanding of how SQL Server implements security, including its authentication and authorization schemes, and how to assign permissions on securable objects to principals. You should know the fundamentals of Transact-SQL to write queries to retrieve data and join data from multiple tables, and how to execute scripts using the query editor in Management Studio. You must also know how to connect to an instance of SQL Server 2012 using the various connection dialog boxes in Management Studio and development tools. It will be very helpful, but not absolutely necessary, to have experience with .NET development using Visual Studio 2012 or later for the portions of the course that deal with SQL Server Data Tools (which is a lot of it). At the very least, we’ll assume that you are well familiar with the Visual Studio user interface. This course assumes no prior knowledge of SQL Server Integration Services.

Learning Paths

This course will help you prepare for the following certifications and exams:
MCSE: Business Intelligence
MCSA: SQL Server 2012/2014
MCSE: Data Platform
70-467: Designing Business Intelligence Solutions with Microsoft SQL Server
70-463: Implementing a Data Warehouse with Microsoft SQL Server 2012/2014

This course is part of the following LearnNowOnline SuccessPaths™:
SQL Server Integration Services

Meet the expert

Don Kiely is a featured instructor on many of our SQL Server and Visual Studio courses. He is a nationally recognized author, instructor, and consultant specializing in Microsoft technologies. Don has many years of teaching experience, is the author or co-author of several programming books, and has spoken at many industry conferences and user groups. In addition, Don is a consultant for a variety of companies that develop distributed applications for public and private organizations.

Course outline



Variables and Expressions

Variables and Data Types (20:24)
  • Introduction (01:04)
  • Variables and Data Types (01:33)
  • Variable Properties (05:07)
  • Variable Data Types (02:49)
  • Variable Data Types Cont. (02:49)
  • Variable Scope (01:25)
  • Variable Scope Cont. (03:50)
  • Parameters (01:22)
  • Summary (00:22)
Where Can You Use Variables (12:21)
  • Introduction (00:52)
  • Demo: Where Can You Use Variables (01:00)
  • Demo: Available Variables and Create (02:02)
  • Demo: Sequence Container (03:00)
  • Demo: Variables Property (01:13)
  • Demo: Filter Variables (03:33)
  • Summary (00:37)
Variables In Control Flows (24:26)
  • Introduction (01:09)
  • Execute SQL Task (01:14)
  • FIle System Task (01:32)
  • Send Mail Task (01:25)
  • Foreach Loop Container (01:03)
  • Script Task (02:27)
  • Expression Task (01:24)
  • Demo: Variables Control Flow (05:31)
  • Demo: Script Task (02:27)
  • Demo: Edit Script (04:18)
  • Demo: Execute (01:23)
  • Summary (00:27)
Variables in Data Flows (40:27)
  • Introduction (00:36)
  • Connection Manager (00:45)
  • Derived Colum Transformation (00:49)
  • ConditionalSplitTransformation (01:20)
  • Parameters (00:23)
  • Property Expressions (01:24)
  • Property Expressions (Cont) (01:37)
  • Using Variables and Parameters (00:18)
  • Demo: New Parameter (02:38)
  • Demo: File System Task (05:07)
  • Demo: Execute SQL Task (03:58)
  • Demo: Script Task (04:23)
  • Demo: OLE DB Source (02:13)
  • Demo: Row Sampling (03:29)
  • Demo: Property Expression (02:18)
  • Demo: Flat File Destination (03:30)
  • Demo: File Location (05:01)
  • Summary (00:29)
Using Expressions (18:11)
  • Introduction (00:47)
  • Using Expressions (01:14)
  • The Language of Expressions (03:07)
  • Identifiers (02:36)
  • Literals (00:43)
  • Operators (01:05)
  • Working with NULLs (03:19)
  • Conditional Expressions (01:30)
  • The Expression Builder (01:41)
  • Expression Builder: Control Flow (00:27)
  • Expression Builder: Data Flow (00:21)
  • Summary (01:13)