Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Autonumbering

Author  Topic 

Snig
Starting Member

1 Post

Posted - 2008-02-06 : 11:09:22
Hi guys,

I am having the worst time with this database I jumped onto recently.

The autonumber feature is leaving a big gap when numbering each entry. They want consistent numbering, ie 1, 2, 3, 4, etc. no gaps.

I had to delete 20 rows so now i'm left with a gap. So now the database displays row id as 220 then jumps to 240. ID number 240 is the last entry, so when I tried to rename it as 221, it gave me the error of "Cannot edit this cell." So I deleted the entry and re-entered the data, and the row id automatically labeled it as 241. How do I set that value as 221?

Thanks!

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-02-06 : 11:13:23
The real question is WHY you need to reseed the table.
You can use SET IDENTITY INSERT Table1 ON to insert new values and overriding IDENTITY column value.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -