Nouman Zakir

while (true) { Post.NewArticle(); }
posts - 13, comments - 12, trackbacks - 0

My Links

News

Archives

Post Categories

Personal Website

Reset table identity (reseed) in SQL Server with DBCC RESEED

You may use DBCC CHECKIDENT to reseed (reset) the identity column of any table in SQL Server.

Example:

A table has 10 rows with 10 as last identity. The next record will automatically genrate 11, to start the new identity use the follwing T SQL query in query analyzer.

DBCC CHECKIDENT (tableName, reseed, 15)

To set the seed to zero use the following T SQL query in query analyzer.

DBCC CHECKIDENT (tableName, reseed, 0)

Avoid using a value lower than the current value, doing this will violate the uniqueness contrant in case of new entries.

Print | posted on Wednesday, February 11, 2009 3:59 AM | Filed Under [ SQL ]

Feedback

Gravatar

# re: Reset table identity (reseed) in SQL Server with DBCC RESEED

Thanks. Found it just when I needed it !
2/11/2009 2:52 PM | Dufrain
Gravatar

# re: Reset table identity (reseed) in SQL Server with DBCC RESEED

Thankewwwwwwwww. It worked
6/22/2009 6:14 AM | HAM
Gravatar

# re: Reset table identity (reseed) in SQL Server with DBCC RESEED

Thanks a mil
7/8/2009 8:23 AM | JWeb
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 

Powered by: