O'Reilly logo

Microsoft SQL Server 2012 Integration Services: An Expert Cookbook by Pedro Perfeito, Reza Rad

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Derived Column: adding calculated columns

Creating customized columns is among the most common requirements in the ETL. The Derived Column Transform provides a way to write custom expressions in order to create new columns or replace existing columns. The customization of generated columns is based on expressions.

In this recipe we will get a list of employees from the EmployeeDepartmentHistory table. We have two columns that serve as sources: StartDate and EndDate. We will fetch a value for the YearsInCompany field by subtracting the StartDate year from the EndDate year; and if EndDate is Null, then subtracting the StartDate from the current date.

Getting ready

Create a new empty file. Name it R01_Destination.csv in the C:\SSIS\Ch03_Data Flow Task-Part ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required