Method 1: If no data is needed, you can directly clear all data and restore the auto-increment field to count from 1.
Truncate table name
Method 2: Set dbcc checkident (''table _ name'', RESEED, new_reseed_value) to new_reseed_value. If the row is not inserted into the table after the table is created, new_reseed_value is used as the ID of the first row inserted after dbcc checkident is executed. Otherwise, new_reseed_value + 1 is used for the next inserted row. If the value of new_reseed_value is smaller than the maximum value in the ID column, error 2627 will be generated when the table is referenced later.
Existing data is not cleared, and the operation is flexible. It can not only return the auto-increment value to zero, but also be used to delete a large number of consecutive rows, reset the auto-increment value and insert new data; or starting from a new value, of course, it cannot conflict with an existing one.