<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Reseed Identity of Table &#8211; Table Missing Identity Values &#8211; Gap in Identity Column</title>
	<atom:link href="http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Fri, 17 May 2013 15:26:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Arul</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-450643</link>
		<dc:creator><![CDATA[Arul]]></dc:creator>
		<pubDate>Sat, 06 Apr 2013 06:34:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-450643</guid>
		<description><![CDATA[Thank u pinal ;-)]]></description>
		<content:encoded><![CDATA[<p>Thank u pinal ;-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #023 &#124; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-450502</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Weekly Series &#8211; Memory Lane &#8211; #023 &#124; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Sat, 06 Apr 2013 01:31:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-450502</guid>
		<description><![CDATA[[...] Reseed Identity of Table – Table Missing Identity Values – Gap in Identity Column Some time ago I was helping one of my Junior Developers who presented me with an interesting situation. He had a table with Identity Column. Because of some reasons he was compelled to delete few rows from the table. On inserting new rows in the table he noticed that the rows started from the next identity value which created gap in the identity value. His application required all the identities to be in sequence, so this was certainly not a small issue for him. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Reseed Identity of Table – Table Missing Identity Values – Gap in Identity Column Some time ago I was helping one of my Junior Developers who presented me with an interesting situation. He had a table with Identity Column. Because of some reasons he was compelled to delete few rows from the table. On inserting new rows in the table he noticed that the rows started from the next identity value which created gap in the identity value. His application required all the identities to be in sequence, so this was certainly not a small issue for him. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Navya</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-418032</link>
		<dc:creator><![CDATA[Navya]]></dc:creator>
		<pubDate>Tue, 05 Feb 2013 07:46:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-418032</guid>
		<description><![CDATA[Now this is simple for a table with fewer columns. what if the table has many columns?]]></description>
		<content:encoded><![CDATA[<p>Now this is simple for a table with fewer columns. what if the table has many columns?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jo Jo</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-324389</link>
		<dc:creator><![CDATA[Jo Jo]]></dc:creator>
		<pubDate>Fri, 03 Aug 2012 19:14:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-324389</guid>
		<description><![CDATA[Hi Pinal,
I need to explain you my situation and wanted to know, if you can help me in that : I really don&#039;t know should I mention this issue in this area of blog or not..Please let me know, if I am on wrong path.


We are using SQL Server 2008 R2. I am doing all my work through Managment Studio. We  Managed Test DB. Due to some primary key issue we reseeded our Test DB (some tables) identity columns to +20000000.(Max Identity now became from 60000+20000000).. Ok now after reseed we take DB backup and restore it to some other DB. After restore we lost whatever we reseeded +20000000..

I know there is no entry in that identity column from those number from 60000 to 20060000..and I wanted to know how should I prevent this problem happening. I don&#039;t want to miss that identity from one Test DB to another Test DB. 
Please let me know, if you need additional information

Thanks
- Jojo]]></description>
		<content:encoded><![CDATA[<p>Hi Pinal,<br />
I need to explain you my situation and wanted to know, if you can help me in that : I really don&#8217;t know should I mention this issue in this area of blog or not..Please let me know, if I am on wrong path.</p>
<p>We are using SQL Server 2008 R2. I am doing all my work through Managment Studio. We  Managed Test DB. Due to some primary key issue we reseeded our Test DB (some tables) identity columns to +20000000.(Max Identity now became from 60000+20000000).. Ok now after reseed we take DB backup and restore it to some other DB. After restore we lost whatever we reseeded +20000000..</p>
<p>I know there is no entry in that identity column from those number from 60000 to 20060000..and I wanted to know how should I prevent this problem happening. I don&#8217;t want to miss that identity from one Test DB to another Test DB.<br />
Please let me know, if you need additional information</p>
<p>Thanks<br />
- Jojo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; List All Missing Identity Values of Table in Database &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-322384</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; List All Missing Identity Values of Table in Database &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Tue, 31 Jul 2012 11:41:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-322384</guid>
		<description><![CDATA[[...] few days ago, one of my readers, Yasmin, asked a very interesting [...]]]></description>
		<content:encoded><![CDATA[<p>[...] few days ago, one of my readers, Yasmin, asked a very interesting [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ditz</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-306460</link>
		<dc:creator><![CDATA[Ditz]]></dc:creator>
		<pubDate>Wed, 27 Jun 2012 12:36:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-306460</guid>
		<description><![CDATA[hi Pinal,

Really thanks to ur explanation.
But in my case, I need to retrieve the top five rows from a table which has no gaps in its primary key, which is generated from a sequence.
can u help me to achieve this output..

thanks in advance,
Ditz]]></description>
		<content:encoded><![CDATA[<p>hi Pinal,</p>
<p>Really thanks to ur explanation.<br />
But in my case, I need to retrieve the top five rows from a table which has no gaps in its primary key, which is generated from a sequence.<br />
can u help me to achieve this output..</p>
<p>thanks in advance,<br />
Ditz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Khan</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-234103</link>
		<dc:creator><![CDATA[Khan]]></dc:creator>
		<pubDate>Mon, 09 Jan 2012 09:29:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-234103</guid>
		<description><![CDATA[I have two tables

s_sl_header and s_sl_detail

bothe tables have serial = serial , in the s_sl_header i have serial,shop, date,
in s_sl_detail , serial, ticket (number)

i want to find missing ticket number and should results are like this

shop ,date,missing ticket
6222 , 01-01-2012, 4432

could you please help me to get the above results in sql2000.

Thanks in advance for your help.]]></description>
		<content:encoded><![CDATA[<p>I have two tables</p>
<p>s_sl_header and s_sl_detail</p>
<p>bothe tables have serial = serial , in the s_sl_header i have serial,shop, date,<br />
in s_sl_detail , serial, ticket (number)</p>
<p>i want to find missing ticket number and should results are like this</p>
<p>shop ,date,missing ticket<br />
6222 , 01-01-2012, 4432</p>
<p>could you please help me to get the above results in sql2000.</p>
<p>Thanks in advance for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER &#8211; Understanding Identity Beyond its Every Increasing Nature &#8211; Quiz &#8211; Puzzle &#8211; 3 of 31 &#171; SQL Server Journey with SQL Authority</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-230912</link>
		<dc:creator><![CDATA[SQL SERVER &#8211; Understanding Identity Beyond its Every Increasing Nature &#8211; Quiz &#8211; Puzzle &#8211; 3 of 31 &#171; SQL Server Journey with SQL Authority]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 01:32:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-230912</guid>
		<description><![CDATA[[...] @@IDENTITY vs SCOPE_IDENTITY() vs IDENT_CURRENT – Retrieve Last Inserted Identity of Record Reseed Identity of Table – Table Missing Identity Values – Gap in Identity Column Discussion – Effect of Missing Identity on System – Real World Scenario Negative Identity Seed [...]]]></description>
		<content:encoded><![CDATA[<p>[...] @@IDENTITY vs SCOPE_IDENTITY() vs IDENT_CURRENT – Retrieve Last Inserted Identity of Record Reseed Identity of Table – Table Missing Identity Values – Gap in Identity Column Discussion – Effect of Missing Identity on System – Real World Scenario Negative Identity Seed [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: håkan englund</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-175592</link>
		<dc:creator><![CDATA[håkan englund]]></dc:creator>
		<pubDate>Thu, 06 Oct 2011 07:26:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-175592</guid>
		<description><![CDATA[don&#039;t delet rows. Mark them resting 0, or active 1 in a column then you dont get gaps]]></description>
		<content:encoded><![CDATA[<p>don&#8217;t delet rows. Mark them resting 0, or active 1 in a column then you dont get gaps</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shivlila</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-86441</link>
		<dc:creator><![CDATA[shivlila]]></dc:creator>
		<pubDate>Fri, 03 Sep 2010 09:27:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-86441</guid>
		<description><![CDATA[Good one]]></description>
		<content:encoded><![CDATA[<p>Good one</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roman</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-83289</link>
		<dc:creator><![CDATA[Roman]]></dc:creator>
		<pubDate>Fri, 06 Aug 2010 18:13:44 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-83289</guid>
		<description><![CDATA[I&#039;ve ran into a similar problem.

I created a DEV database, where IDs started at 1.  
I created a TEST database where IDs started at 10000
and in PROD the seed was 20000.

This was for a files table, which kept track of all uploaded files from an application.

Initially that was ok, so that there was a buffer between the different servers, and it was easy to tell what&#039;s where and why.

But a day came when someone needed to copy prod data to Test.  And then when testers began testing on the Test server, all the files in the 20000 range, started to be overwritten with the test files.

I tried to go back into the DB and reseed it again to like 11000, but it didn&#039;t work, and kept on inserting in the 20000 range. 

It would be great if there was a way to say ok, there are a bunch of skipped IDs, go and fill those first, and then skip over the existing ones and keep going.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve ran into a similar problem.</p>
<p>I created a DEV database, where IDs started at 1.<br />
I created a TEST database where IDs started at 10000<br />
and in PROD the seed was 20000.</p>
<p>This was for a files table, which kept track of all uploaded files from an application.</p>
<p>Initially that was ok, so that there was a buffer between the different servers, and it was easy to tell what&#8217;s where and why.</p>
<p>But a day came when someone needed to copy prod data to Test.  And then when testers began testing on the Test server, all the files in the 20000 range, started to be overwritten with the test files.</p>
<p>I tried to go back into the DB and reseed it again to like 11000, but it didn&#8217;t work, and kept on inserting in the 20000 range. </p>
<p>It would be great if there was a way to say ok, there are a bunch of skipped IDs, go and fill those first, and then skip over the existing ones and keep going.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gene</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-77556</link>
		<dc:creator><![CDATA[gene]]></dc:creator>
		<pubDate>Thu, 24 Jun 2010 20:14:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-77556</guid>
		<description><![CDATA[great, thanks!  solves my problem.]]></description>
		<content:encoded><![CDATA[<p>great, thanks!  solves my problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lxocram</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-65323</link>
		<dc:creator><![CDATA[Lxocram]]></dc:creator>
		<pubDate>Fri, 16 Apr 2010 12:44:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-65323</guid>
		<description><![CDATA[NOTE: (now that my relationships are all properly defined SSMS auto-adjusts the types in dependent tables)  was surrounded by &quot;dreaming&quot; html tags]]></description>
		<content:encoded><![CDATA[<p>NOTE: (now that my relationships are all properly defined SSMS auto-adjusts the types in dependent tables)  was surrounded by &#8220;dreaming&#8221; html tags</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lxocram</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-65322</link>
		<dc:creator><![CDATA[Lxocram]]></dc:creator>
		<pubDate>Fri, 16 Apr 2010 12:41:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-65322</guid>
		<description><![CDATA[Cropping identity columns&#039;s is just plain fun:

* it forces you to recheck that all tables that depend on that column are linked trough a foreign key constraint and are properly defined in diagrams

* to finally solve the multiple cascade paths could lead to 
cycle issue trough writing custom update procedure/triggers

*to rethink if certain decisions you made in the passed, based on the set of business constraints at that time, are still valid now

*to make column names over the database less ambigious

*hey my cropped identity fits in a smaller type (now that my relationships are all properly defined SSMS auto-adjusts the types in dependent tables) 

*finally the traces of importing data out of various databases, tables, the work of others ... are starting to fade, aahh a fresh start. i feel so clean, finally i can delete that useless foreign key column that points to a non-exisiting database
it starts to look as though i built it from scratch without the clutter of other co-developers
jada jada (getting emotional)

*BUT it remains utterly pointless none the less, pointless but fun!]]></description>
		<content:encoded><![CDATA[<p>Cropping identity columns&#8217;s is just plain fun:</p>
<p>* it forces you to recheck that all tables that depend on that column are linked trough a foreign key constraint and are properly defined in diagrams</p>
<p>* to finally solve the multiple cascade paths could lead to<br />
cycle issue trough writing custom update procedure/triggers</p>
<p>*to rethink if certain decisions you made in the passed, based on the set of business constraints at that time, are still valid now</p>
<p>*to make column names over the database less ambigious</p>
<p>*hey my cropped identity fits in a smaller type (now that my relationships are all properly defined SSMS auto-adjusts the types in dependent tables) </p>
<p>*finally the traces of importing data out of various databases, tables, the work of others &#8230; are starting to fade, aahh a fresh start. i feel so clean, finally i can delete that useless foreign key column that points to a non-exisiting database<br />
it starts to look as though i built it from scratch without the clutter of other co-developers<br />
jada jada (getting emotional)</p>
<p>*BUT it remains utterly pointless none the less, pointless but fun!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ZanyarFromIran</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-62049</link>
		<dc:creator><![CDATA[ZanyarFromIran]]></dc:creator>
		<pubDate>Tue, 02 Mar 2010 23:54:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-62049</guid>
		<description><![CDATA[We should suppose that the ID column in this problem is not a PrimaryKey column. Because when we try to reorder a PrimaryKey column, we are in a incorrect direction. The main property of a PrimaryKey is that it should be unchanged all the time.]]></description>
		<content:encoded><![CDATA[<p>We should suppose that the ID column in this problem is not a PrimaryKey column. Because when we try to reorder a PrimaryKey column, we are in a incorrect direction. The main property of a PrimaryKey is that it should be unchanged all the time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anuj</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-60029</link>
		<dc:creator><![CDATA[Anuj]]></dc:creator>
		<pubDate>Thu, 21 Jan 2010 11:22:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-60029</guid>
		<description><![CDATA[Can we use other thing rather then IDENTITY Column, and it can work if 100 Users hit the Table and Always get the Unique ID.

If there is any thing please do update me .....

[email address removed due to privacy issue]]]></description>
		<content:encoded><![CDATA[<p>Can we use other thing rather then IDENTITY Column, and it can work if 100 Users hit the Table and Always get the Unique ID.</p>
<p>If there is any thing please do update me &#8230;..</p>
<p>[email address removed due to privacy issue]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tbetz</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-59667</link>
		<dc:creator><![CDATA[tbetz]]></dc:creator>
		<pubDate>Tue, 12 Jan 2010 20:18:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-59667</guid>
		<description><![CDATA[I&#039;m using the MS book &quot;build a program now visual basic 2008&quot; to learn sql. Unfortunately, the one database example uses the identity numbers fropm one table as the column of another table. My simple example reseeded one table when i fixed a few typos, with no way to renumber the identiy column. So, it seems the advise here is to never refer to an identity column in another table, which I will try hard to follow. It appears that one author at MS hasn&#039;t learned this lesson yet.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m using the MS book &#8220;build a program now visual basic 2008&#8243; to learn sql. Unfortunately, the one database example uses the identity numbers fropm one table as the column of another table. My simple example reseeded one table when i fixed a few typos, with no way to renumber the identiy column. So, it seems the advise here is to never refer to an identity column in another table, which I will try hard to follow. It appears that one author at MS hasn&#8217;t learned this lesson yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pinal Dave</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-59257</link>
		<dc:creator><![CDATA[Pinal Dave]]></dc:creator>
		<pubDate>Sat, 02 Jan 2010 04:32:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-59257</guid>
		<description><![CDATA[Hello Jeswin,

Deleted identity value is not used. There are some workarounds to get identity of deleted records. One is described here:

http://msdn.microsoft.com/en-us/library/ms186775.aspx

but that is not recommended for large tables as it degrade the performance of insert statements.

Regards,
Pinal Dave]]></description>
		<content:encoded><![CDATA[<p>Hello Jeswin,</p>
<p>Deleted identity value is not used. There are some workarounds to get identity of deleted records. One is described here:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms186775.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms186775.aspx</a></p>
<p>but that is not recommended for large tables as it degrade the performance of insert statements.</p>
<p>Regards,<br />
Pinal Dave</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeswin</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-59225</link>
		<dc:creator><![CDATA[Jeswin]]></dc:creator>
		<pubDate>Fri, 01 Jan 2010 08:05:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-59225</guid>
		<description><![CDATA[hi sir,

i am not a regular reader but i have used ur tips and tricks for my knowledge.I am some confused about identity , that when i have 10 records in that i have deleted only one record that is 7 th record. then my identity no 7 will be missing for ever and even my identities are not in order .so will u let me know me how to reorder them .

Thank You,]]></description>
		<content:encoded><![CDATA[<p>hi sir,</p>
<p>i am not a regular reader but i have used ur tips and tricks for my knowledge.I am some confused about identity , that when i have 10 records in that i have deleted only one record that is 7 th record. then my identity no 7 will be missing for ever and even my identities are not in order .so will u let me know me how to reorder them .</p>
<p>Thank You,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DK</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-59156</link>
		<dc:creator><![CDATA[DK]]></dc:creator>
		<pubDate>Wed, 30 Dec 2009 21:22:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-59156</guid>
		<description><![CDATA[One reason I can think of when this may be needed.

Lets say we have a lookup table where identity field was tinyint rather than int. Lets say someone entered 250 values that are now not required. 


Before now we delete those values and want to insert 10 new lookup values. But I will not be able to do so as I would have run out of numbers. Resetting the identity seed will allow me to enter my values.

This is just one example of where resetting identity seed may be helpful..... There may be other ones...]]></description>
		<content:encoded><![CDATA[<p>One reason I can think of when this may be needed.</p>
<p>Lets say we have a lookup table where identity field was tinyint rather than int. Lets say someone entered 250 values that are now not required. </p>
<p>Before now we delete those values and want to insert 10 new lookup values. But I will not be able to do so as I would have run out of numbers. Resetting the identity seed will allow me to enter my values.</p>
<p>This is just one example of where resetting identity seed may be helpful&#8230;.. There may be other ones&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kamol</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-58751</link>
		<dc:creator><![CDATA[kamol]]></dc:creator>
		<pubDate>Thu, 17 Dec 2009 09:38:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-58751</guid>
		<description><![CDATA[It was very helpful to me.
Thanks]]></description>
		<content:encoded><![CDATA[<p>It was very helpful to me.<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mahesh Nair</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-57485</link>
		<dc:creator><![CDATA[Mahesh Nair]]></dc:creator>
		<pubDate>Tue, 10 Nov 2009 10:51:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-57485</guid>
		<description><![CDATA[My humble experience of past few years (as a Sr.System Analyst &amp; DB Architect) support the comments by Mr.IrishManInUSA also I support  Mr.Ed McInerney. 
I believe Mr. Pinal was just conveying about such a method. 
The application of this thing may vary depends on situation. Anyway it&#039;s very useful for a table with a dedicated column for customizable sort order, rather than the concept of primary key resorting.]]></description>
		<content:encoded><![CDATA[<p>My humble experience of past few years (as a Sr.System Analyst &amp; DB Architect) support the comments by Mr.IrishManInUSA also I support  Mr.Ed McInerney.<br />
I believe Mr. Pinal was just conveying about such a method.<br />
The application of this thing may vary depends on situation. Anyway it&#8217;s very useful for a table with a dedicated column for customizable sort order, rather than the concept of primary key resorting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: harish</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-55220</link>
		<dc:creator><![CDATA[harish]]></dc:creator>
		<pubDate>Wed, 26 Aug 2009 05:18:00 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-55220</guid>
		<description><![CDATA[Hi pinal,

thank you 

thank you very much




Thanks &amp; regrads

Harishkumar.M]]></description>
		<content:encoded><![CDATA[<p>Hi pinal,</p>
<p>thank you </p>
<p>thank you very much</p>
<p>Thanks &amp; regrads</p>
<p>Harishkumar.M</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ed McInerney</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-54417</link>
		<dc:creator><![CDATA[Ed McInerney]]></dc:creator>
		<pubDate>Tue, 04 Aug 2009 12:08:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-54417</guid>
		<description><![CDATA[Some of the critics here are forgetting about inherited code and data (not OO inheritence, hand-me-down code).

I just inherited a DB table that contains an ID column and an order number column that was not originally an Identity column. So, all records are unique on the ID PK column, but *should* also be unique on the order number as well...they are NOT.

Some records have a NULL order number and some order numbers are duplicated. The difficulty is in making the decisions of how to rectify these issues:

Can we delete the data if it is older? That is simple.

If not, how to make this an Identity column and still retain the existing order numbers for historical purposes? SQL Server 2005 doesn&#039;t let you make an existing column IDENTITY: &quot;You cannot modify an existing table column to add the IDENTITY property.&quot;

How to find gaps (un-used numbers) around the same date range of the records with NULL or duplicate order numbers to try to use those to fix the bad records...we could simply use the next highest order number, but the users intuitively know the approximate date of the orders based on the order number and this would throw them off.

If anyone has suggestions for these real-world issues, I&#039;d be interested in hearing them.]]></description>
		<content:encoded><![CDATA[<p>Some of the critics here are forgetting about inherited code and data (not OO inheritence, hand-me-down code).</p>
<p>I just inherited a DB table that contains an ID column and an order number column that was not originally an Identity column. So, all records are unique on the ID PK column, but *should* also be unique on the order number as well&#8230;they are NOT.</p>
<p>Some records have a NULL order number and some order numbers are duplicated. The difficulty is in making the decisions of how to rectify these issues:</p>
<p>Can we delete the data if it is older? That is simple.</p>
<p>If not, how to make this an Identity column and still retain the existing order numbers for historical purposes? SQL Server 2005 doesn&#8217;t let you make an existing column IDENTITY: &#8220;You cannot modify an existing table column to add the IDENTITY property.&#8221;</p>
<p>How to find gaps (un-used numbers) around the same date range of the records with NULL or duplicate order numbers to try to use those to fix the bad records&#8230;we could simply use the next highest order number, but the users intuitively know the approximate date of the orders based on the order number and this would throw them off.</p>
<p>If anyone has suggestions for these real-world issues, I&#8217;d be interested in hearing them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Drew Wells</title>
		<link>http://blog.sqlauthority.com/2009/04/01/sql-server-reseed-identity-of-table-table-missing-identity-values-gap-in-identity-column/#comment-53435</link>
		<dc:creator><![CDATA[Drew Wells]]></dc:creator>
		<pubDate>Thu, 02 Jul 2009 20:07:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=4195#comment-53435</guid>
		<description><![CDATA[We are having an issue with the identify column of one of our normalized tables.  The primary key (identity) of TableA is referenced by TableB and TableC.  

When we went to move this table from one database to another, the identity column was reseeded.  This of course caused havoc with our data since records were being paired incorrectly.

Is there a way around this?]]></description>
		<content:encoded><![CDATA[<p>We are having an issue with the identify column of one of our normalized tables.  The primary key (identity) of TableA is referenced by TableB and TableC.  </p>
<p>When we went to move this table from one database to another, the identity column was reseeded.  This of course caused havoc with our data since records were being paired incorrectly.</p>
<p>Is there a way around this?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
