Monday, November 8, 2010

Forcing the current identity value to a new value

Forcing the current identity value to a new value

The following example forces the current identity value in the BusinessEntityID column in the Employee table to a value of 300. Because the table has existing rows, the next row inserted will use 301 as the value, that is, the current identity value plus 1, the current increment value defined for the column.

SQL
USE AdventureWorks2008R2;
GO
DBCC CHECKIDENT ("HumanResources.Employee", RESEED, 300);
GO

No comments:

Post a Comment