I have a table with both an IDENTITY column and a DateTime column set by GetDate() like this:
CREATE TABLE [MyTable](
[Id] [int] IDENTITY(1,1) ,
[InsertTime] [datetime] DEFAULT (getdate()),
[OtherValues] [int]
)
All the INSERTs are preformed with default values for the IDENTITY and DateTime column like this:
INSERT INTO [MyTable] ([OtherValues]) VALUES (1)
always as standalone statements outside any explicit Transaction.
I would expect that Id would be strict increasing and InsertTime also be increasing but not strict. But with heavy load we see a few instances like this:
| Id | InsertTime |
|------|-------------------------|
| 3740 | 2015-03-05 10:07:25.560 |
| 3741 | 2015-03-05 10:07:25.557 |
| 3742 | 2015-03-05 10:07:25.577 |
where we have a slight drop in InsertTime.
Does anyone know how this happens and what is the "right" order of the rows?