Programmer's Rules

SQL Server

How to set starting and step values for IDENTITY in SQL Server

Generating automatic column values with IDENTITY keyword using seed and increment parameters

SQL Serverjob interview70-761

In order to automatically generate sequential values in a column when rows are inserted into a table we can use IDENTITY keyword.

The column with IDENTITY must be of a numeric data type with a scale 0 - that is of types: int, bigint, smallint, tinyint or decimal (with a scale of 0) or numeric (with a scale of 0). For example:

Optionally it is possible to set seed (starting value) and increment (set value), as in the following code:

IDENTITY(50, 10) means that while inserting into a table, without specifying the Id column value, the Id will start from 50 and will be incremented by 10.
Tutorial statistics