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
 General SQL Server Forums
 New to SQL Server Programming
 Identity (Sql Server 2005 Developer's Edition)

Author  Topic 

rpc86
Posting Yak Master

200 Posts

Posted - 2009-09-24 : 23:52:03
Hi guys,

How to reset the identity seed of a column? Say I deleted from 9 to 15, then I want to add records and it will start on 8th?

Please help

Thank you.

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-09-25 : 00:58:28
dbcc checkident('tablename',reseed,8)
Go to Top of Page

Nageswar9
Aged Yak Warrior

600 Posts

Posted - 2009-09-25 : 00:58:30
Hi, Try this once

delete table where id between 9 and 15

dbcc checkident('tablename',reseed,8)
Go to Top of Page

rpc86
Posting Yak Master

200 Posts

Posted - 2009-09-25 : 02:07:52


Thank you very much. Both suggestions work well.

I appreciate

[Resolved]
Go to Top of Page

bklr
Master Smack Fu Yak Hacker

1693 Posts

Posted - 2009-09-25 : 02:19:29
welcome
Go to Top of Page
   

- Advertisement -