Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

datetime vs smalldatetime

If I don't care about less than seconds, what should be the recommended type to store my datetime values in sql-server 2005, is it datetime or smalldatetime or else?

like image 867
Shimmy Weitzhandler Avatar asked Nov 29 '09 01:11

Shimmy Weitzhandler


1 Answers

smalldatetime has a resolution down to one minute, so if that resoulution is OK for you, smalldatetime is 50% smaller (4 bytes vs. 8 bytes) so is preferred.

See http://karaszi.com/the-ultimate-guide-to-the-datetime-datatypes for a good overview.

like image 70
Justin Grant Avatar answered Oct 05 '22 00:10

Justin Grant