Procedure is sync, ok? But, how explain that.
I have a table with the fields (not specific like that):
ID INT PRIMARY KEY IDENTITY,
DATE DATETIME NOT NULL
The insert executed by SP is: (This SP is call inside another one)
INSERT TABLE VALUES ( SYSDATETIME() )
BUT, the table values are:
ID | DATETIME
6 | 2017-08-23 09:40:00.000
7 | 2017-08-23 09:39:46.690
How is it possible? The ID 6 is "the most up-to-date", not ID 7.
In our context we need to order by IDENTITY field. I cannot order the query by DateTime, because the others fields. E.g.:
ID | DATETIME | ACTION
6 | 2017-08-23 09:40:00.000 | Production Start
7 | 2017-08-23 09:39:46.690 | Production End
I executed the End action before the Start action. The timeline is wrong.