TSQL : Start Identity at 0 or 1

An identity column automatically increments by a set interval and a set starting point.

If you want to start your identity values at 1, then increment by 1…

CREATE TABLE [YourSchema].[YourTable](

[YourKeyColumn] [int] IDENTITY(1,1) NOT NULL.....

If you want to start your identity values at 0, then increment by 1…

CREATE TABLE [YourSchema].[YourTable](

[YourKeyColumn] [int] IDENTITY(0,1) NOT NULL.....

If you want to start your identity values at 0, then increment by 5…

CREATE TABLE [YourSchema].[YourTable](

[YourKeyColumn] [int] IDENTITY(0,5) NOT NULL.....

About AussieBICG

Connect with me here https://au.linkedin.com/in/aussiebicg

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s