Solved

What is the difference between smalldatetime and datetime?

Posted on 2007-11-15
4
6,458 Views
Last Modified: 2009-02-25
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
Comment
Question by:Tom Knowlton
  • 2
4 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 20290499
Hello knowlton,

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


Aneesh R
0
 
LVL 17

Assisted Solution

by:Chris Mangus
Chris Mangus earned 100 total points
ID: 20290519
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
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 400 total points
ID: 20290520
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
 
LVL 5

Author Comment

by:Tom Knowlton
ID: 20290653
Thanks!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question