sql server datetime vs datetime2

Solutions on MaxInterview for sql server datetime vs datetime2 by the best coders in the world

showing results for - "sql server datetime vs datetime2"
Vincent
02 Aug 2020
1The MSDN documentation for datetime recommends using datetime2. Here is their recommendation:
2
3Use the time, date, datetime2 and datetimeoffset data types for new work. These types align with the SQL Standard. They are more portable. time, datetime2 and datetimeoffset provide more seconds precision. datetimeoffset provides time zone support for globally deployed applications.
4
5datetime2 has larger date range, a larger default fractional precision, and optional user-specified precision. Also depending on the user-specified precision it may use less storage.