What you want to see on DotNetFunda.com ?
Go to DotNetFunda.com
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 42209 |  Welcome, Guest!   Register  Login
Home > Articles > Sql Server > Use of Derived column in SSIS

Use of Derived column in SSIS

Article posted by Madhu.b.rokkam on 2/28/2011 | Views: 17184 | Category: Sql Server | Level: Beginner | Points: 250 red flag


In this article we will go through the functionality of derived column in SSIS.

Introduction

SSIS has many transformations tasks and Derived column is one of them.

In this article we will try to do a sample in which we will try to use a derived column in deriving a new column at runtime and use it. Let's say we have a file in which we have Salary and Bonus as two fields and we need to calculate the gross salary, or to change the name into upper case or do some sort of calculations then we go with the derived columns.

Scenario, We have a file containing name, salary and bonus as three fields and we will use our SSIS package to generate a new file which will have derived field Gross salary and display the name filed in capital letters.

So Lets Start...

1. Open MS BI Development studio. Select an Integration Services Project that will load Package1.dtsx

2, Drag and Drop a data flow task as shown.

3. Double click on the data flow task, And place a Flat file source, a derived column transformation task and a flat file destination task.

4. Configure the flat file source by double clicking that, Create a flat file source connection and select a sample input file path, Preview your columns by clicking the columns tab. Gotot advanced and change the datatype to integer for column 3 and column 4 And then click ok.

5. Similary configure the Flat file destination task.

6. Double click on derived column transformation task and configure it to derive the gross salary and Name with upper case columns

In the derived transformation editor, select the replace column1 [Since Column1 is for name field] from the Derive column drop down. Drag drop the Upper expression from the string functions and use it as shown.

7. Smilarly derive another column for Gross Amount. Next double click on Destination file and map the columns to the output file. Click Ok

8. Before we run the package we need to put the input file in the input location. then Execute the package.

9.See the output file.

Thats it.. Simple

Hope you all liked it. Please comment on it.

If you like this article, subscribe to our RSS Feed. You can also subscribe via email to our Interview Questions, Codes and Forums section.

Page copy protected against web site content infringement by Copyscape
Found interesting? Add this to:



Please Sign In to vote for this post.

About Madhu Rokkam

Experience:0 year(s)
Home page:http://www.dotnetfunda.com
Member since:Thursday, January 13, 2011
Level:Bronze
Status: [Member] [MVP]
Biography:
>> Write Response - Respond to this post and get points
Related Posts

The SSIS Package Store is a nice option to available for storing SSIS packages. The Package Store list packages stored on the server in the MSDB folder and all packages stored on the file system as long as they are in the default folder (C:\Program Files\Microsoft SQL Server\100\DTS\Packages for SQL 2008) in the File System folder. It is possible to adjust the Package Store to look for packages in different file system folders or different server instances. To do this you must change the MsDtsSrvr.ini.xml file in the C:\Program Files\Microsoft SQL Server\100\DTS\Binn (folder is in SQL 2008 only).

SET and SELECT both key words are used to Assign Variables in SQL Server. SET and SELECT both specifies the columns to be changed and the new values for the columns. The values in the specified columns are updated with the values specified in the SET and SELECT in all rows that match the WHERE clause search condition. If no WHERE clause is specified, all rows are updated.

This article will be useful for beginners of T-SQL to create Primary Key and Foreign Key in SQL Server 2008.

This is part 14 of the series of article on SSIS. In this article I shall describe the folder structure used in Deploying the SSIS package and the usage of those folders.

One of the nightmares of a developer is the deadlock. The main source of a deadlock is the backend code, SQL Server scripts. In this article, we will discuss about how to use the SQL Profiler to capture the deadlocks in SQL Statements.

More ...
About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/21/2013 8:24:36 AM