0

I have a table which receives many rows and therefore the ID (int) grows. Before the insert of the rows almost all rows of the table will get deleted (not all) and so many IDs will become free to use again. But with new inserted rows the ID grow further from the former max value.

If the ID reaches its final max. value, will SQL Server assign the free IDs to new rows or will it throw an error?

Dale K
  • 25,246
  • 15
  • 42
  • 71
user11909
  • 1,235
  • 11
  • 27
  • Already covered in this [Server Fault question](https://serverfault.com/questions/226105/sql-server-2008-what-happened-if-identity-oversteps-a-maximal-value-of-int). You will get an overflow, but keep in mind that ints in SQL Server go up to 2 billiion. How many records do you really expect to insert and delete? – Tim Biegeleisen Jul 01 '20 at 10:14
  • What is your speed of adding rows? Like how many rows per some time unit? – Lasse V. Karlsen Jul 01 '20 at 10:39
  • @LasseV.Karlsen I actually don't know. It's up to the customer. – user11909 Jul 01 '20 at 11:02
  • Well, then the server fault question is your general answer. Whether it will be a problem or not in the foreseeable future is thus up to the customer. – Lasse V. Karlsen Jul 01 '20 at 11:29

0 Answers0