how to increment ID to 1.2.3.4 etc not 1000,2000,3000

how to increment ID to 1.2.3.4 etc not 1000,2000,3000

Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Naveen KumarRank #249 · 10K reputationPosted Jul 21, 2024, 11:29 AM EDT
Hi MohamedEid,
If the ID column is already set as an IDENTITY, you can truncate the table and reinsert the data. Otherwise, you can configure the column as an IDENTITY following below steps.
IDENTITYcolumn.Aman GuptaRank #193 · 12.4K reputationPosted Jul 22, 2024, 1:03 AM EDT
Hi MohammadEid,
If you have an existing table and need to reset the
IDENTITYproperty:Check Current Identity:
DBCC CHECKIDENT ('MyTable', NORESEED);Reset Identity to a specific value:
DBCC CHECKIDENT ('MyTable', RESEED, 0);This sets the next ID to start from 1 again. If you need a custom increment logic (e.g., 1, 2, 3, 4), use a custom sequence or handle it programmatically.
Tahir AnsariRank #366 · 6.8K reputationPosted Jul 21, 2024, 9:39 AM EDT
Hi Mohammad,
ALTER TABLE dbo.ExistingTable ADD ID INT IDENTITY(1, 1) PRIMARY KEY;This statement adds a new
IDcolumn toExistingTablewith theIDENTITYproperty starting from 1 and incrementing by 1.Jaimin ShethiyaRank #177 · 13.7K reputationPosted Jul 22, 2024, 3:16 AM EDT
Hello Mohammad,
Please refer this below links.
https://learn.microsoft.com/en-us/answers/questions/517365/sql-server-id-jump-1000-issue-fixed-in-sql-server
https://stackoverflow.com/questions/14146148/identity-increment-is-jumping-in-sql-server-database
Thanks