I have noticed that SQL Sever (2008 Express) is randomly jumping forwards when it is inserting auto-incrementing identity specifications.
For example one of my columns "HitStat_ID" will insert sequentially 15, 16, 17, 18, then all of a sudden, it will decide to jump to, say 1012, 1013, 1014.... then 9120, 9121 etc.
It doesn't matter really, so long as they are unique (which they are) but why would it do this? Its doing it in more than one table too. The odd thing is that is only done this over the last week or so, but the application has been in development for months!
I'm working in ASP.NET VB.
This is the insert (in this case):
sql = "INSERT INTO [HitStats] ([PageName], [Date_and_Time], [User_ID]) values ('Home',
'" + TheDateTime + "', '" + Session("User_ID") + "')"
Dim dbcmd As SqlCommand = New SqlCommand(sql, dbconn)
dbcmd.ExecuteNonQuery()
dbcmd.Dispose()
Please don't go on about SQL injection - its not going to happen!