## 1. Change the current value of an auto increment
#### View a table in an auto-increment the current value:
DBCC CHECKIDENT (TableName)
#### to modify a table auto-increment the current value:
DBCC CHECKIDENT (TableName, RESEED, value)
RESEED不是列名,固定写法。
#### For example, I want Division table from the current value to be added to 30 can use the following command
DBCC CHECKIDENT (Division, RESEED, 30)
and then
DBCC CHECKIDENT (Division)
you can see the display of the current value is 30
## 2.SQL forcibly inserted identification data column
set identity_insert table on - Turns
insert into table (automatic growth ID column, ......) values (100, ......)
set identity_insert table off - Close
example:
set identity_insert tblClass on - Turns
insert into tblClass (cid,cname) values (100,‘java班’)
set identity_insert tblClass off - close
## 3. The following error occurs, for example,
Cannot update identity column