<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Generating Surrogate Keys</title>
	<atom:link href="http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/</link>
	<description>Random thoughts and experiences with SSIS, by Phil Brammer</description>
	<lastBuildDate>Wed, 25 Jan 2012 10:27:44 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Bob</title>
		<link>http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/comment-page-1/#comment-48979</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Sun, 22 Jan 2012 18:37:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/#comment-48979</guid>
		<description>I have the same problem as AS.  In SSIS 2008, I can&#039;t get the key from the script into the OLE DB Destination task.  When I put a dataviewer between the Script Transformation task and the OLE DB Destination task, it doesn&#039;t show anything. 

Thanks,
Bob</description>
		<content:encoded><![CDATA[<p>I have the same problem as AS.  In SSIS 2008, I can&#8217;t get the key from the script into the OLE DB Destination task.  When I put a dataviewer between the Script Transformation task and the OLE DB Destination task, it doesn&#8217;t show anything. </p>
<p>Thanks,<br />
Bob</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bali</title>
		<link>http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/comment-page-1/#comment-38086</link>
		<dc:creator>bali</dc:creator>
		<pubDate>Thu, 27 Oct 2011 13:46:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/#comment-38086</guid>
		<description>Hi,

This seems to be a good solution. But Can we have some custom component to generate incremental value so that the logic can be reused, instead of using SQLTask and script component in each packages.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>This seems to be a good solution. But Can we have some custom component to generate incremental value so that the logic can be reused, instead of using SQLTask and script component in each packages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AS</title>
		<link>http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/comment-page-1/#comment-1695</link>
		<dc:creator>AS</dc:creator>
		<pubDate>Sat, 04 Jul 2009 14:29:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/#comment-1695</guid>
		<description>We are running into issues when generating surrogate keys in Sql Server 2008. the code works great with SQl server 2005.  

The surrogate key does not get passed to the package.

Any ideas????</description>
		<content:encoded><![CDATA[<p>We are running into issues when generating surrogate keys in Sql Server 2008. the code works great with SQl server 2005.  </p>
<p>The surrogate key does not get passed to the package.</p>
<p>Any ideas????</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joseph</title>
		<link>http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/comment-page-1/#comment-577</link>
		<dc:creator>Joseph</dc:creator>
		<pubDate>Wed, 03 Sep 2008 08:49:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/#comment-577</guid>
		<description>The solution is very good. Thanks for it.
But you mentioned that Row Number Transformation task can also be used. I don&#039;t know how. If I want to use incremental data extraction I have to pass the biggest surrogate key (already ditributed to the dimension table) to the Row Number Transformation&#039;s Seed property. But it is not exposed through Expression so I can&#039;t change its value dynamicly. Maybe I miss something or the task is quite inflexible.</description>
		<content:encoded><![CDATA[<p>The solution is very good. Thanks for it.<br />
But you mentioned that Row Number Transformation task can also be used. I don&#8217;t know how. If I want to use incremental data extraction I have to pass the biggest surrogate key (already ditributed to the dimension table) to the Row Number Transformation&#8217;s Seed property. But it is not exposed through Expression so I can&#8217;t change its value dynamicly. Maybe I miss something or the task is quite inflexible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Renato Buda</title>
		<link>http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/comment-page-1/#comment-231</link>
		<dc:creator>Renato Buda</dc:creator>
		<pubDate>Thu, 26 Jul 2007 08:53:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/#comment-231</guid>
		<description>Thanks - this is a great solution and tutorial.

The function should have been in the product to start with.
You have used to opportunity to present a handy introduction to the data transformation script component.</description>
		<content:encoded><![CDATA[<p>Thanks &#8211; this is a great solution and tutorial.</p>
<p>The function should have been in the product to start with.<br />
You have used to opportunity to present a handy introduction to the data transformation script component.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: khanhmy</title>
		<link>http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/comment-page-1/#comment-14</link>
		<dc:creator>khanhmy</dc:creator>
		<pubDate>Thu, 15 Mar 2007 08:05:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/#comment-14</guid>
		<description>Hi Phil,

I&#039;ve already inserted new rows into DimTable using &quot;generating surrogate key&quot;. Everything runs well. :) :P :D

I&#039;ve read the topic: &quot;Checking to see if a record exists and if so update else insert&quot; many times. 

Unfortunely, in my case, existing data needs update as historical data and then all changed rows are inserted as current data.

Would you give me some suggestions not to  route notEqualChecksum output to staging table? 

In my scenario, the notEqualChecksum output first goes straight to the SQLCommand for update after that to staging destination.

For inserting changed rows, I must get the MaxKey and generate surrogate keys again. 

I have not much changed data to store ouside the buffer. So, It seem I&#039;m going on the long way.  :(

Hope you can help me! Thank you! 


khanhmy</description>
		<content:encoded><![CDATA[<p>Hi Phil,</p>
<p>I&#8217;ve already inserted new rows into DimTable using &#8220;generating surrogate key&#8221;. Everything runs well. <img src='http://www.ssistalk.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  <img src='http://www.ssistalk.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  <img src='http://www.ssistalk.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>I&#8217;ve read the topic: &#8220;Checking to see if a record exists and if so update else insert&#8221; many times. </p>
<p>Unfortunely, in my case, existing data needs update as historical data and then all changed rows are inserted as current data.</p>
<p>Would you give me some suggestions not to  route notEqualChecksum output to staging table? </p>
<p>In my scenario, the notEqualChecksum output first goes straight to the SQLCommand for update after that to staging destination.</p>
<p>For inserting changed rows, I must get the MaxKey and generate surrogate keys again. </p>
<p>I have not much changed data to store ouside the buffer. So, It seem I&#8217;m going on the long way.  <img src='http://www.ssistalk.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>Hope you can help me! Thank you! </p>
<p>khanhmy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil Brammer</title>
		<link>http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/comment-page-1/#comment-13</link>
		<dc:creator>Phil Brammer</dc:creator>
		<pubDate>Wed, 14 Mar 2007 14:44:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/#comment-13</guid>
		<description>Khanhmy,
The red arrow in this case is coming off of a lookup transformation and indicates NEW records that do not exist in the destination.

Every NEW record will pass through the script transformation and hence obtain a new, unique surrogate key.

I am positive that the select statement will always return the maxValue correctly, because it happens before the dataflow.  The select statement is needed to see what the current maximum surrogate key is in the table before we start processing records.  No other process touches the destination table (in my case) so yes, it is correct in its operation.</description>
		<content:encoded><![CDATA[<p>Khanhmy,<br />
The red arrow in this case is coming off of a lookup transformation and indicates NEW records that do not exist in the destination.</p>
<p>Every NEW record will pass through the script transformation and hence obtain a new, unique surrogate key.</p>
<p>I am positive that the select statement will always return the maxValue correctly, because it happens before the dataflow.  The select statement is needed to see what the current maximum surrogate key is in the table before we start processing records.  No other process touches the destination table (in my case) so yes, it is correct in its operation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: khanhmy</title>
		<link>http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/comment-page-1/#comment-12</link>
		<dc:creator>khanhmy</dc:creator>
		<pubDate>Wed, 14 Mar 2007 12:23:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/#comment-12</guid>
		<description>Hi Phil,


Generating surrogate key is very very cool! 


Thanks alot,</description>
		<content:encoded><![CDATA[<p>Hi Phil,</p>
<p>Generating surrogate key is very very cool! </p>
<p>Thanks alot,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: khanhmy</title>
		<link>http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/comment-page-1/#comment-11</link>
		<dc:creator>khanhmy</dc:creator>
		<pubDate>Wed, 14 Mar 2007 05:57:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/#comment-11</guid>
		<description>Hi Phil,

I wonder if the red arrow contents new dim data to be inserted. And It might comes from the Checksum transformation.

In your scenario, every new record will be assigned a new surrogate key after it has gone thru the Script component, will it?  

Are you sure that the select statment always return the maxValue exactly when the data haven&#039;t arrived to the destinestion yet.

thank you for sharing experience,

khanhmy</description>
		<content:encoded><![CDATA[<p>Hi Phil,</p>
<p>I wonder if the red arrow contents new dim data to be inserted. And It might comes from the Checksum transformation.</p>
<p>In your scenario, every new record will be assigned a new surrogate key after it has gone thru the Script component, will it?  </p>
<p>Are you sure that the select statment always return the maxValue exactly when the data haven&#8217;t arrived to the destinestion yet.</p>
<p>thank you for sharing experience,</p>
<p>khanhmy</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil Brammer</title>
		<link>http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/comment-page-1/#comment-5</link>
		<dc:creator>Phil Brammer</dc:creator>
		<pubDate>Wed, 21 Feb 2007 20:29:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.ssistalk.com/2007/02/20/generating-surrogate-keys/#comment-5</guid>
		<description>It&#039;s not really hard as I&#039;ve illustrated.  

The issue (and why I hate identity columns) is that the data is more portable when you generate your own surrogate keys.  When using identity columns and have referential integrity enforced, moving data from one landscape to another generally breaks that integrity.  This is especially important in fact/dimension modeling.  When using your own counter as I&#039;ve talked about (I&#039;m not the pioneer in this concept, by the way) it is quite simple and accurate to copy the data from one landscape to another without breaking the integrity.</description>
		<content:encoded><![CDATA[<p>It&#8217;s not really hard as I&#8217;ve illustrated.  </p>
<p>The issue (and why I hate identity columns) is that the data is more portable when you generate your own surrogate keys.  When using identity columns and have referential integrity enforced, moving data from one landscape to another generally breaks that integrity.  This is especially important in fact/dimension modeling.  When using your own counter as I&#8217;ve talked about (I&#8217;m not the pioneer in this concept, by the way) it is quite simple and accurate to copy the data from one landscape to another without breaking the integrity.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

