Tag Info

New answers tagged

0

Rumtscho, If you're only creating 1000 rows per day, there is little to decide--use the INT data type with an Identity field and be done with it. Simple math says if you give your app a 30 year lifecycle (unlikely) you could have 200,000 rows per day and still be within the positive number range of an INT data type. Using BigInt is overkill in your case, ...


1

There is a gap between the used values ? Or the starting values is 10.000 and from then on all are adding 1 ? Sometimes if the number is going to be given to customers, the initial number is greater than zero, let's say 1500 for example, so the customer do not realize the system is "new". The drawback of using bigint instead of smallint is that as bigint ...


1

If you are really concerned hitting the upper threshold of INT for your PKs, consider using GUIDs. Yes, I know it's 16 bytes vs 4 bytes, but disk is cheap. Here's a good write-up of pros and cons.


5

The main task to do is to find the root cause why the current value is that high. The most reasonable explanation for SQL Server versions prior to SQL2012 -assuming you're talking about a test database- would be that there was a load test followed by a cleanup. Starting with SQL2012 the most probable reason is due to several restarts of the SQL Engine (as ...


19

Without seeing code, it is pretty hard to say conclusively what is happening. Although, most likely the IDENTITY value is being cached, causing gaps in the value after SQL Server is restarted. See http://stackoverflow.com/questions/17587094/identity-column-value-suddenly-jumps-to-1001-in-sql-server for some good answers and info about that. A simple INT ...



Top 50 recent answers are included