<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BI Monkey &#187; Data Conversion</title>
	<atom:link href="http://www.bimonkey.com/tag/data-conversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bimonkey.com</link>
	<description>James Beresford on Microsoft BI and Consulting in Sydney, Australia</description>
	<lastBuildDate>Mon, 23 Jan 2012 22:01:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>The Data Conversion Transformation</title>
		<link>http://www.bimonkey.com/2009/06/the-data-conversion-transformation/</link>
		<comments>http://www.bimonkey.com/2009/06/the-data-conversion-transformation/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 01:03:09 +0000</pubDate>
		<dc:creator>BI Monkey</dc:creator>
				<category><![CDATA[Integration Services]]></category>
		<category><![CDATA[Data Conversion]]></category>
		<category><![CDATA[Data Types]]></category>

		<guid isPermaLink="false">http://www.bimonkey.com/?p=335</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<div class="wp-caption alignnone" style="width: 235px"><img title="The Data Conversion Transformation" src="http://www.bimonkey.com/uploads/componentreview/dataconversion1.jpg" alt="b" width="225" height="66" /><p class="wp-caption-text">Fig 1: The Data Conversion Transformation</p></div>
<p>In this post I will be covering the Data Conversion Transformation. The sample package can be found <a title="SQL 2005 SSIS Data Conversion Sample (Right Click, Save As)" href="http://www.bimonkey.com/uploads/componentreview/Data%20Conversion%20Transformation%20Basics%202005.zip">here for 2005</a> and guidelines on use are <a title="Using samples from BI Monkey" href="http://www.bimonkey.com/support/using-ssis-samples-from-this-site/">here</a>.</p>
<h2>What does the Data Conversion do?</h2>
<p>The transformation takes input columns and creates a <em>copy </em>of that column with a new data type. This is a vital component in SSIS because SSIS is very fussy about Data Types &#8211; you cannot force an integer typed column into a string destination. It should go &#8211; in theory &#8211; 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.</p>
<p>Configuring the component is pretty simple &#8211; 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.</p>
<div class="wp-caption alignnone" style="width: 694px"><img title="Configuring the Data Conversion Transformation" src="http://www.bimonkey.com/uploads/componentreview/dataconversion2.jpg" alt="b" width="684" height="99" /><p class="wp-caption-text">Fig 2: Configuring the Data Conversion Transformation</p></div>
<p>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 &#8211; 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&#8217;t, so be careful. There is a demonstration of this in the sample package in Data Flow 2.</p>
<h2>When would you convert Data to a new Type?</h2>
<p>The need for this kind of change is manifold &#8211; two of my most common uses would be converting data from text files to the correct types &#8211; from strings into dates, numbers, currency etc. &#8211; and when moving data between relational systems. While an ADO .NET source may give you data as one general type &#8211; say an int, you may want to put it in a different type field for an SQL Server database, such as a tinyint.</p>
<p>MSDN Documentation for the Data Conversion Transformation can be found here for <a title="SQL 2008 Data Conversion Transformation Documentation on MSDN" href="http://msdn.microsoft.com/en-us/library/ms141706.aspx">2008</a> and here for <a title="SQL 2005 Data Conversion Transformation Documentation on MSDN" href="http://msdn.microsoft.com/en-us/library/ms141706(SQL.90).aspx">2005</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bimonkey.com/2009/06/the-data-conversion-transformation/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

