How to reset identification in a table

My scenario ... I am creating a table as (identifier identifier (1,1) is not null, name is varchar (500), category is varchar (50)) ... I am trying to insert values ​​.. displays have (1, "sede", "diabetes"), and it has 1,2,3. But when I delete the general content ... paste it again with 4,5,6 ...

I do not need this type of insert ... When I delete the content, it should start with 1,2,3 ..

How can I achieve this .. I need this in a stored procedure .. Any idea ..

+3
source share
1 answer

You can reset Identity seed by running dbcc checkident

DBCC CHECKIDENT ("TableName", RESEED, 0)
+7
source

Source: https://habr.com/ru/post/1751536/


All Articles