Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Set column Identity value to 0, 1, and so on
Message
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Set column Identity value to 0, 1, and so on
Divers
Thread ID:
01637908
Message ID:
01637908
Vues:
55
Hi,

I have a table in SQL Server that currently has NO rows/records. There is a PK column set to Identity Yes. I want to make this column values to start with 0 (zero). Here is what I did:
1. Set Identity of this column to Off
2. Added a record/row to this column and set the value to 0 (zero).
3. Set Identity of this column back to On

Now when I add a new record, SQL Server sets the value to this column as 2.

How can I make it start with 1 (after I already added a record of 0)?

TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform