Go Back   CORTEX Forums > Local Happenings > CORTEX Blogs > BI Monkey
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read

The Data Conversion Transformation

This is a discussion on The Data Conversion Transformation within the BI Monkey forums, part of the CORTEX Blogs category; Fig 1: The Data Conversion Transformation In this post I will be covering the Data Conversion Transformation. The sample package can be found* here for 2005 and guidelines on use ...


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 23rd June 2009, 09:34 PM   #1
Guru
 
Join Date: Jun 2009
Posts: 122
James Beresford is on a distinguished road
Thumbs up The Data Conversion Transformation

Fig 1: The Data Conversion Transformation


In this post I will be covering the Data Conversion Transformation. The sample package can be found*here for 2005 and guidelines on use are here.

What does the Data Conversion do?

The transformation takes input columns and creates a copy of that column with a new data type. This is a vital component in SSIS because SSIS is very fussy about Data Types - you cannot force an integer typed column into a string destination. It should go - in theory - but this strictness prevents sloppy errors and more importantly allows SSIS to be truly platform independent by ensuring its internal data types can be reliably matched to the target.

Configuring the component is pretty simple - you pick your input column, set the name of the output and pick the target data type. Depending on the target data type you may have other configuration options such as precision, scale, length or code page. The snapshot below is taken from the sample package.

Fig 2: Configuring the Data Conversion Transformation


An important thing to be aware of is how the Data Conversion transform handles missing data. A blank field will return an error when you try to convert it to pretty much anything but a string - if you have missing values that you want to sail through this component, you must convert them to NULLs first, as a NULL can be converted (to the appropriate NULL) but a blank string is technically a value, and one that cannot be validly converted. It would be good if there was an option to treat blanks as nulls, but for now there isn’t, so be careful. There is a demonstration of this in the sample package in Data Flow 2.

When would you convert Data to a new Type?

The need for this kind of change is manifold - two of my most common uses would be converting data from text files to the correct types - from strings into dates, numbers, currency etc. - and when moving data between relational systems. While an ADO .NET source may give you data as one general type - say an int, you may want to put it in a different type field for an SQL Server database, such as a tinyint.

MSDN Documentation for the Data Conversion Transformation can be found here for 2008 and here for 2005.



More...
James Beresford is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTweet this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Fuzzy Lookup Transformation James Beresford BI Monkey 0 23rd June 2009 09:34 PM
Data Mart V Data Warehousing - The geat Debate binboy Data Warehousing Tips and Techniques 1 16th July 2008 11:15 AM


All times are GMT +11. The time now is 01:49 PM.

© The Business Intelligence Group

Search Engine Optimization by vBSEO