且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

删除后在SQL Server中重置自动增量

更新时间:2022-12-04 20:57:02

发出以下命令重新设置mytable的种子,使其从1开始:

Issue the following command to reseed mytable to start at 1:

DBCC CHECKIDENT (mytable, RESEED, 0)

在联机丛书(BOL,SQL帮助)中阅读有关此内容的信息.另外请注意,您的记录没有比您设置的种子高.

Read about it in the Books on Line (BOL, SQL help). Also be careful that you don't have records higher than the seed you are setting.