2010/04/21

SQL - How to reset identity increment value is MSSQL?

run the script below...BRAVO!

DBCC CHECKIDENT ( #table_name# ,RESEED, #number_starting_from#)

#table_name# = the table you wish to reset the identity increment
#number_starting_from# = the number you wish to reset to. For example, if you wish to start your new item at 1, then put in 0, like the example below:

DBCC CHECKIDENT ( my_table ,RESEED, 0)

Enjoy!

No comments:

Post a Comment