What is the difference between smalldatetime and datetime?

Under SLQ Server 2005, what is the difference between smalldatetime and datetime?

If I just want to store a date (not interested in time of day) what is best?

Thanks!

Tom
LVL 5
Tom KnowltonWeb developerAsked:
Who is Participating?
 
Aneesh RetnakaranConnect With a Mentor Database AdministratorCommented:
datetime
Date and time data from January 1, 1753 through December 31, 9999, to an accuracy of one three-hundredth of a second (equivalent to 3.33 milliseconds or 0.00333 seconds). Values are rounded to increments of .000, .003, or .007 seconds, as shown in the table.

smalldatetime
Date and time data from January 1, 1900, through June 6, 2079, with accuracy to the minute. smalldatetime values with 29.998 seconds or lower are rounded down to the nearest minute; values with 29.999 seconds or higher are rounded up to the nearest minute.

0
 
Aneesh RetnakaranDatabase AdministratorCommented:
Hello knowlton,

Go for smalldatetime, which takes only 4 bytes while the datetime requires 8 bytes


Aneesh R
0
 
Chris MangusConnect With a Mentor Database AdministratorCommented:
As to the difference, datetime will allow a greater range of dates to be stored whereas smalldatetime limits the range quite a bit.

Agree, smalldatetime takes less space to store.
0
 
Tom KnowltonWeb developerAuthor Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.