Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to renumber an Identity column?

Status
Not open for further replies.

jaylou

Programmer
Feb 17, 2005
70
0
0
US
I have a table with an Identity column. When rows are deleted the Sequence goes out of whack, Is there a way to restart the numbering at 1 and go to whatever?

TIA,
Joe
 
See DBCC CHECKIDENT with RESEED option in Books Online... together with some limitations explained there.

------
[small]<this is sig>
select stuff(stuff(replicate('<P> <B> ', 14), 109, 0, '<.'), 112, 0, '/')
</this is sig>[/small]
[banghead]
 
Thanks,
Doesn't reseed only deal with new rows coming into the table? I want to update the present rows back to 1 thru blah, right now my table starts at 7,8,9,23,45,56,57,58,59...

Thanks again
 
my sincere advice is: don't do it

just leave the numbers alone

if you are using them for anything, you shouldn't be

if you could tell us what that is, we might be able to help you do what you want to do without renumbering them

r937.com | rudy.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top