开发者

How to reset identity in Table

开发者 https://www.devze.com 2023-01-04 09:29 出处:网络
My scenario is... I create Table as(id identity(1,1) not null,name varchar(500),category varchar(50))... i try to insert values.. displays has (1,\'sede\',\'diabetes\') and it goes has 1,2,3. But when

My scenario is... I create Table as(id identity(1,1) not null,name varchar(500),category varchar(50))... i try to insert values.. displays has (1,'sede','diabetes') and it goes has 1,2,3. But when i delete the total content.. once again insert it starts with 4,5,6...

I don wan开发者_开发百科t this type of inserting...When content i deleted it should start from 1,2,3..

How can i achieve this.. i need it in stored procedure.. Any idea..


You can reset the Identity seed by executing dbcc checkident

DBCC CHECKIDENT ("TableName", RESEED, 0)
0

精彩评论

暂无评论...
验证码 换一张
取 消