Which type, between smalldatetime
and datetime2(0)
, is the most performant to store datetime values with a minute precision?
Thanks in advance!
Which type, between smalldatetime
and datetime2(0)
, is the most performant to store datetime values with a minute precision?
Thanks in advance!
These types align with the SQL Standard. They are more portable.
This means that if you want to develop applications against the database, you will have a wider flexibility choosing languages and platforms because those formats are more widely implemented.
datetimeoffset support for globally deployed applications.
This means that if your application is deployed to regional settings different from say the US it will be more compatible with the client OS settings.
smalldatetime is going to perform better because it is using less bytes, plain and simple. However it might not be the best choice for an application for the reasons above. Also, it depends on infrastruture limitations, the number of records and design (joins etc...). I have queried against datetime2 columns on tables with hundreds of millions of records and received sub second results.