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

The Script Component as a Transformation

Writing scripts in Data Flow is another major aspect of scripting in SSIS. The Script Component is one of the most powerful components in SSIS Data Flow and is usable as Source, Transformation, and Destination.

In this recipe, we will use a Transformation Script Component to create a row number, besides other columns in the data stream, because there is no Row Number Transformation in SSIS Toolbox.

How to do it...

  1. Create an SSIS project and name it R02_ScriptComponent as Transformation.
  2. Add a Data Flow Task from the SSIS Toolbox and go to the Data Flow tab.
  3. Add an OLE DB Source, create a Connection to the AdventureWorks2012 database, and set the Data Access Mode as Table or View, and choose HumanResources.Department ...

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