How to Choose the Best Date and Time Data Types for a SQL Server Database
Select the optimum data type for date and time columns to meet your requirements. It can minimize data storage needs, boost performance, and reduce expenses.
When designing and implementing a Microsoft SQL Server database, it is best to equip yourself with awareness of all available data types, including the date and time types. Choosing the best-suited date and time type for each column that will store date and time values will ensure that the database implementation will meet storage and processing requirements over the short and long terms.
This article describes each data and time data type and how to select the one that best meets your needs.
Date and Time Data Type Definitions
The following sections summarize the date and time data types available in SQL Server. See detailed descriptions in the Date & time type pages of Microsoft’s Transact-SQL (T-SQL) Reference documentation. All date and time data types, except for time, are based on the Gregorian calendar.
Here is an overview of the date and time data types:
- date — Stores dates from 0001–01–01 through…