SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Advantage of using date and time in 2008 over 2005 datetime


Advantage of using date and time in 2008 over 2005 datetime

Author
Message
sharmili.net
sharmili.net
SSC Rookie
SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)SSC Rookie (27 reputation)

Group: General Forum Members
Points: 27 Visits: 44
Hi Everyone,

Hope all is well.

We can store date and time separately in 2008,but when we are using 2005 we have only datetime and smalldatetime data types.

I need to know what is the advantage of using these separated data types?Whether its about memory storage or something else?

Please text me the answer.

Thank you,
Sharmi.
Koen Verbeeck
Koen Verbeeck
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27257 Visits: 13268
You only use date and time if you need them seperately.
For example, for a lot of data you only need the date part. The birthdate is a good example.

In SQL Server 2008 you can use the date data type, in 2005 you need to use datetime and store an unnecessary time portion. (in most cases 00:00:00)

Another example is the opening hours of a store. In 2008, you can use the time data type, in 2005 still datetime. This resulted in a "dummy" date, such as 1900-01-01, together with the actual time portion.

With the seperate data types, you can be more efficient and store only what is necessary.

Furthermore, if you need to store an actual point in time (date and time portion), you can use datetime2 in 2008, which has far better precision.


How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?
My blog at SQLKover.

MCSE Business Intelligence - Microsoft Data Platform MVP
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search