datetime2
DATETIME2 is a date and time data type used in SQL Server and Azure SQL Database. It stores both date and time information with configurable fractional-second precision, from 0 to 7. The default precision is 7, allowing up to 100 nanosecond resolution.
The data type supports a broad date range: 0001-01-01 through 9999-12-31, with the time portion ranging from
DATETIME2 is designed as a higher-precision, wider-range successor to the older DATETIME type (and SMALDATETIME). It
The data type is declared as DATETIME2[(n)], where n is the fractional-second precision from 0 to 7.
Related functions and usage include casting and converting values to and from DATETIME2, and using system functions
In practice, DATETIME2 is commonly used for accurate timestamps, event logging, and any scenario requiring precise
---