如何重置表认同 [英] How to reset identity in Table
本文介绍了如何重置表认同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的情况是......我CREATE TABLE AS(ID身份(1,1)NOT NULL,名字为varchar(500),类别为varchar(50))...我尝试插入值..显示已(1 ,塞代,糖尿病),并进入具有1,2,3。但是,当我删除的总含量..再次插入与4,5,6 ...开始
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...
我不希望这种类型的插入...当内容我删除它应该从1,2,3开始..
I don want 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..
推荐答案
您可以通过执行的 DBCC CHECKIDENT
DBCC CHECKIDENT ("TableName", RESEED, 0)
这篇关于如何重置表认同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文