I needed to export some data out of Application Insights and save it locally. While doing a sanity check, I realized that some of my datetime values were not the same.
Therefore, I created a simple test.
- Create a table with just a datetime field.
- Insert the value I expected.
- Select that data back out and witness the rounded value.
I finally found an answer here:
https://stackoverflow.com/questions/36414315/inserting-datetime-with-milliseconds-into-sql-server-table-issue
MS SQL rounds the DateTime field in increments of .000, .003, and .007. I would assume that means it is saving on memory space behind the scenes by only offering 3 options for the single digit of milliseconds?
Whatever the case, if precision is necessary (as it was for the Application Insights data I was getting), use the newer datetime2(3) field definition.
