<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SET IDENTITY_INSERT little bug(?)</title><link>http://sqlblog.com/blogs/davide_mauri/archive/2009/09/30/set-identity-insert-little-bug.aspx</link><description>While I was working on a package to incrementally load a dimension in the DWH I’m developing for a customer, I stumbled upon a tricky little bug (I think, I still have to have a response from MS) that had – and will have – a little impact on how I create</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>re: SET IDENTITY_INSERT little bug(?)</title><link>http://sqlblog.com/blogs/davide_mauri/archive/2009/09/30/set-identity-insert-little-bug.aspx#17151</link><pubDate>Wed, 30 Sep 2009 15:53:46 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:17151</guid><dc:creator>Paul Nielsen</dc:creator><description>&lt;p&gt;Your identity values have meaning such that a skipped number causes grief? why? &lt;/p&gt;
</description></item><item><title>re: SET IDENTITY_INSERT little bug(?)</title><link>http://sqlblog.com/blogs/davide_mauri/archive/2009/09/30/set-identity-insert-little-bug.aspx#17152</link><pubDate>Wed, 30 Sep 2009 16:06:19 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:17152</guid><dc:creator>Adam Machanic</dc:creator><description>&lt;p&gt;Why don't you just script the values you expect for your dimensions and turn off IDENTITY altogether? That's what I do, when I want predictability...&lt;/p&gt;
</description></item><item><title>re: SET IDENTITY_INSERT little bug(?)</title><link>http://sqlblog.com/blogs/davide_mauri/archive/2009/09/30/set-identity-insert-little-bug.aspx#17156</link><pubDate>Wed, 30 Sep 2009 16:48:43 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:17156</guid><dc:creator>Davide Mauri</dc:creator><description>&lt;p&gt;Hi guys, your question was expected :-)&lt;/p&gt;
&lt;p&gt;I discovered this bug just by chance. I have a dimension that gets populated from SAP. Some SAP numeric codes doesn't have any lookup table so we have external tables that allows us to map, say, code 100 to &amp;quot;Company group 1&amp;quot; (for example). So this dimension is created joining SAP tables with our lookup table.&lt;/p&gt;
&lt;p&gt;During development, to speed up the first release of a cube so that people can start to validate it, I inserted the rows in the lookup table by hand, setting code 100 to id 1.&lt;/p&gt;
&lt;p&gt;Each time a person reported the he has validated his portion of data, we wrote unit test to automatize testing to validate all future changes. One of the test checks that a specific company is put into a specific company group.&lt;/p&gt;
&lt;p&gt;In that test we used the ID of the company group, which I inserted by hand, to check that values are correct.&lt;/p&gt;
&lt;p&gt;Now, since all dimensions are incrementally populated (SCD 1 or 2), I don't expect IDs to change, so I was confident that I can use them for testing purposes, instead of having to join all the tables to check for the correct values.&lt;/p&gt;
&lt;p&gt;When I created a SSIS package to load the values automatically and then I deployed everything in a new enviroment with empty dimension tables, I found this little problem.&lt;/p&gt;
&lt;p&gt;As already said, this is a very small bug, but can give you small headaches to understand what's happened, so I filed a connect bug to keep track of it.&lt;/p&gt;
&lt;p&gt;That's it :-)&lt;/p&gt;
</description></item><item><title>re: SET IDENTITY_INSERT little bug(?)</title><link>http://sqlblog.com/blogs/davide_mauri/archive/2009/09/30/set-identity-insert-little-bug.aspx#17172</link><pubDate>Thu, 01 Oct 2009 11:47:36 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:17172</guid><dc:creator>Ben Thul</dc:creator><description>&lt;p&gt;I'm not saying that the behavior exhibited by SQL Server is correct, but why not create the table with the identity seed that you want and call it a day? &amp;nbsp;&lt;/p&gt;
</description></item><item><title>re: SET IDENTITY_INSERT little bug(?)</title><link>http://sqlblog.com/blogs/davide_mauri/archive/2009/09/30/set-identity-insert-little-bug.aspx#17188</link><pubDate>Fri, 02 Oct 2009 05:34:58 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:17188</guid><dc:creator>Davide Mauri</dc:creator><description>&lt;p&gt;@Ben: thanks for the suggestion, but I've already found a workaround. I've posted it on connect too.&lt;/p&gt;
</description></item></channel></rss>