[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 6577
  • Last Modified:

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
0
Tom Knowlton
Asked:
Tom Knowlton
  • 2
2 Solutions
 
Aneesh RetnakaranDatabase AdministratorCommented:
Hello knowlton,

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


Aneesh R
0
 
Chris MangusDatabase 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
 
Aneesh RetnakaranDatabase 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
 
Tom KnowltonWeb developerAuthor Commented:
Thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now