开发者

How to reset identity in Table

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜