Pregunta

I have a SQL Server database table that includes a column for the record number, which increments by one for each record. The data is received from an iPhone app that our field crews use for recording vehicle mileage. On Thursday 4/10 the final record number of the day was 2997, received at about 6:00 pm. On Friday 4/11 at 8:00 am, with the first received record of the day, the increment jumped to 3997, a jump of 1,000.

Is this something I need to be concerned about? Is it an anomaly of SQL Server that occasionally happens? Or could there be something in my VB 2010 server program that is cutting loose and trying to write to the database?

As far as my system is concerned, a gap in the record numbers doesn't matter as long as the system doesn't try to go back and fill them in out of sequence.

I'm pretty sure that it can't be attributed to hacking or other malicious intent, because each transaction between the iPhone and the server program is recorded in log files and there's no indication that any activity occurred in that interval.

Any ideas about this?

Thanks!

¿Fue útil?

Solución

As said, if you have an identity field on the column which you have mentioned and if there was some data that was inserted in a transaction and rolled back after that, the identity field is still set to that value.

meaning, if I have an auto incrementing field and a transaction with 10 records, my auto increment field is now at 10 and starts for 11. I rollback the transaction, but the auto incrementing number doesn't go back to 1, but it will still start at 11.

Unless and until there is something behind the screen other than straight forward inserts, this should cause no issues to you, as said.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top