SQL Server IDENTITY columns are numeric columns which are set to auto increment when new values are inserted into the table. These columns are great for uniquely identifying records in a table, especially when you do not have any natural key to define a primary key constraint on the table. Like a primary key, there can only be one IDENTITY property defined on a column in a table.
An IDENTITY column has a seed value (where the values begin) and the numeric increment value for each new record inserted. When new values are inserted into the table, the new valued will be based on the increment value of the identity column. The first value inserted into the table will have the value of seed value as specified.
The following data types can have the IDENTITY property set for them: decimal, int, numeric, smallint, bigint, and tinyint.
answered
1 year ago
by anonymous