Reset identity seed after deleting records in SQL Server -
I have recorded a record in a SQL Server database table. A primary key was defined in the table and the seed to identify auto increment has been determined. This is mainly because SQL is done in Ezur, the primary key and identity must be defined in each table.
But since I have to delete some of the records from the table, the seed of identity will be disturbed for those tables and the index will be disturbed by the column (which is generated by the increment of 1).
How can I reset the column in the ascending order in the numerical order after the record? The identity column is not used in the foreign key anywhere in the database. Management command is used to reset the identity counter. Example: This Azure was not supported in previous versions of SQL database, but is now supported.
DBCC Investigator ('[TestTable]', Race, 0); GO
Comments
Post a Comment