T-SQL Tutorial

SQL Increment


Identity Syntax:

CREATE TABLE new_table
(
column_name_1 PRIMARY KEY IDENTITY,
column_name_2 datatype,
....
column_name_n datatype
);

Identity Example:

CREATE TABLE sales
(
id int PRIMARY KEY IDENTITY,
price int,
name varchar(50)
);