0

My primary keys in Azure database is jumping I've read that i should be worried. what if i run out of numbers? The table I have will eventually reach around 10000 records Ex. PrimaryID 1000 1001 1002

then after how many records 2000 2001

right now it is in 11693+

and i only have 600+ records. app is in-house use but will definitely grow once we start making it public

the table is as simple as it can get. im not trying to squish in much data as i can in one table.

  • the reason of jumping is described in https://stackoverflow.com/questions/14146148/identity-increment-is-jumping-in-sql-server-database – Michael Freidgeim Apr 19 '23 at 06:59

1 Answers1

0

instead of using a numbered index, you could look into something such as GUID's instead, as unique identifiers. Or if you need it to be something number indexed, you could grab the highest existing record id, add one to it, and use an identity insert, such as described here.. How do you UPDATE an identity column in SQL azure? Is it possible?

Community
  • 1
  • 1
user2366842
  • 1,231
  • 14
  • 23
  • Ive thought about this approach. unfortunately that would mean changing the entire database. Plus I use those IDs to create a public ID. is there a reason why this happens? – Denise Michelle del Bando Sep 18 '13 at 14:32
  • It looks like this stuff does happen from time to time in azure (and potentially other databases too) can be caused from transaction rollbacks (would only cause small jumps) or potentially shifting of the database to another physical location. Take a look here for some more information. http://social.msdn.microsoft.com/Forums/windowsazure/en-US/e1fad557-9f0a-4907-a054-85bcc9d4fe55/sql-azure-tables-primary-key-jumped-from-11-to-1001 – user2366842 Sep 18 '13 at 21:56