<?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>Rob Boek &#187; indexes</title>
	<atom:link href="http://robboek.com/tag/indexes/feed/" rel="self" type="application/rss+xml" />
	<link>http://robboek.com</link>
	<description></description>
	<lastBuildDate>Sat, 15 May 2010 19:16:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SQL Server Uniqueifier Values and the Number of the Beast</title>
		<link>http://robboek.com/2009/02/13/sql-server-uniqueifier-values-and-the-number-of-the-beast/</link>
		<comments>http://robboek.com/2009/02/13/sql-server-uniqueifier-values-and-the-number-of-the-beast/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 19:36:32 +0000</pubDate>
		<dc:creator>Rob Boek</dc:creator>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[indexes]]></category>
		<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://robboek.com/?p=118</guid>
		<description><![CDATA[Reading Gail Shaw’s post All indexes are unique, reminded me of an interesting piece of trivia I discovered back in SQL Server 7. The error message for running out of uniqueifier values is 666.

SELECT TEXT FROM sys.messages WHERE message_id = 666

Returns:
The maximum system-generated unique value for a duplicate group was exceeded for index with partition [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Reading Gail Shaw’s post <a href="http://sqlinthewild.co.za/index.php/2009/02/09/all-indexes-are-unique/">All indexes are unique</a>, reminded me of an interesting piece of trivia I discovered back in SQL Server 7. The error message for running out of uniqueifier values is <a href="http://en.wikipedia.org/wiki/Number_of_the_Beast#666">666</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #0000FF;">SELECT</span> <span style="color: #0000FF;">TEXT</span> <span style="color: #0000FF;">FROM</span> sys.<span style="color: #202020;">messages</span> <span style="color: #0000FF;">WHERE</span> message_id <span style="color: #808080;">=</span> <span style="color: #000;">666</span></pre></div></div>

<p>Returns:</p>
<blockquote><p>The maximum system-generated unique value for a duplicate group was exceeded for index with partition ID %I64d. Dropping and re-creating the index may resolve this; otherwise, use another clustering key.</p></blockquote>
<p>Here is what <a href="http://msdn.microsoft.com/en-us/library/ms190639.aspx">SQL Server 2008 Books Online – Clustered Index Design Guidelines</a> says :</p>
<blockquote><p>If the clustered index is not created with the UNIQUE property, the Database Engine automatically adds a 4-byte <strong>uniqueifier</strong> column to the table. When it is required, the Database Engine automatically adds a <strong>uniqueifier</strong> value to a row to make each key unique. This column and its values are used internally and cannot be seen or accessed by users.</p></blockquote>
<p>Someone on the SQL Server team definitely had a sense of humor, because to actually see this message, you would have to insert over 4,294,967,296 duplicate entries into your clustered index column. Anyone who would do that is truly evil.</p>
]]></content:encoded>
			<wfw:commentRss>http://robboek.com/2009/02/13/sql-server-uniqueifier-values-and-the-number-of-the-beast/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
