SmallDateTime vs DateTime
Size
- A SmallDateTime data type is a 4 bytes date and time.
- A DateTime data type is a 8 bytes date and time.
Date range
- SmallDateTime: From January 1, 1900 00:01 (AM), until June 6, 2079 23:59 (PM)
- DateTime: From January 1, 1753, 00:00:00:03 (AM) until December 31, 9999 23:59:59:99:99 (PM)
- If you need a date range between the 18th century and the 20th century or need dates greater than 2079 then use DateTime.
Precision
- SmallDateTime: A 1 minute precision. It does not keep track of the seconds.
- DateTime: A 3.33 milliseconds precision. The values are rounded to increments of .000, .003, or .007 seconds.
- DECLARE @vardate01 DATETIME;
- DECLARE @vardate02 SMALLDATETIME;
- SET @vardate01 = GETDATE();
- SET @vardate02 = GETDATE();
- SELECT @vardate01 AS 'Full Date & Time',
- @vardate02 AS 'Small Date & Time';
- go
- SELECT CAST('2007-06-11 14:45:12.789' AS DATETIME) AS '8 bytes Date & Time',
- CAST('2007-06-11 14:45:12.789' AS SMALLDATETIME) AS '4 bytes Date & Time';
- GO
Full Date & Time Small Date & Time ----------------------- ----------------------- 2007-06-11 14:32:56.297 2007-06-11 14:33:00 (1 row(s) affected) 8 bytes Date & Time 4 bytes Date & Time ----------------------- ----------------------- 2007-06-11 14:45:12.790 2007-06-11 14:45:00 (1 row(s) affected)
If you can, use a SmallDateTime data type instead of DateTime data type:
- It is smaller, therefore less disk space and IO.
- It is faster to process.













