CREATE TABLE ... IDENTITY
engine-generated increasing values on INSERT
What changes
- Input
- table definition
- Output or change
- identity column
Syntax at a glance
column_name datatype IDENTITY [ ( seed , increment ) ]
Work example
A table needs an engine-generated numeric key for newly inserted rows.
Choose seed and increment from the key range and test insert behavior without assuming gap-free values.
Check your work Each lab insert receives a distinct value within the chosen type's range.
Open Microsoft Learn for full syntax, permissions, and details for your version.