Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can an identity column be zero?
Message
 
 
To
27/11/2010 18:07:10
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2008
Miscellaneous
Thread ID:
01490715
Message ID:
01490717
Views:
62
>I checked the documentation and can't find an answer to this.
>Will an identify column ever have a value of zero?
>I note that when I add the first record, it's 1.

Yes, it can be 0. You can start from -2,147,483,648 till the 2,147,483,647 if you're using int for the identity column (E.g.
create table IdentityRange (ID int identity(-2,147,483,648,1) primary key, other columns)
It's a common technique to start with the min. integer if you want to expand the total number of records for the table and don't want to use bigint.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform