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
 SQL Server Development (2000)
 How do I reset "indentity increment" value?

Author  Topic 

Riku Tuominen
Starting Member

22 Posts

Posted - 2002-07-01 : 10:24:54
How do I reset "indentity increment" counter value
after emptying a table?

Increment number still keeps starting from 1402 even if I had
emtied the table. In Access I would just compact the table
and autocounter would be reset.
I tried shcrink database on SQL server, that did not help.

joshb
Yak Posting Veteran

52 Posts

Posted - 2002-07-01 : 10:29:16
Check out the DBCC command CHECKIDENT in Books Online.

Josh

Go to Top of Page

Riku Tuominen
Starting Member

22 Posts

Posted - 2002-07-01 : 10:32:50
Thanks I found old anware on this forum.

"Thanks very much
Turning off then on the identity was enought to reset the counter !
Jonathan"

Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2002-07-01 : 10:34:06
Also, if you TRUNCATE TABLE, the identity is reset.

Go to Top of Page
   

- Advertisement -