extension joomla, template joomla,banner extension joomla,jomla slider,slider joomla
Reset indentity value of Auto increment Key to 0 in SQL server 2008

I have been searching for resetting the Auto increment value of ID Column in MSSQL Server 2008 and finally solved the problem. You can simply do the following in SQL.

The following line resets the Identity value for the ‘MyTable’ table to 0 so that the next record added starts at

DBCC CHECKIDENT(‘MyTable’, RESEED, 0)

The truncate command can also does the trick but its not applicable if there are some foreign key constraints.

For more information on DBCC CHECKINDENT you can refer MSDN.http://msdn.microsoft.com/en-us/library/ms176057.aspx

Loading...


Related Article



destination source:https://www.programming-techniques.com/2012/06/reset-indentity-value-of-auto-increment-key-to-0-in-sql-server-2008.html