Home >Database >Mysql Tutorial >SQL Server自增字段归零_MySQL

SQL Server自增字段归零_MySQL

WBOY
WBOYOriginal
2016-06-01 13:47:201016browse

bitsCN.com

假设有一数据库表admin.ROLE,现已在其中多次插入删除数据,使得自增字段当前值混乱。于是可通过下列语句,重新设定自增字段的起始值。但要注意在数据库表中不能存在相同的自增字段值。

DBCC CHECKIDENT (admin.ROLE, RESEED, 0) 

 

bitsCN.com
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn