Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can an identity column be zero?
Message
 
 
À
27/11/2010 18:07:10
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2008
Divers
Thread ID:
01490715
Message ID:
01490717
Vues:
63
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform