Advantage of using date and time in 2008 over 2005 datetime

  • 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.

  • 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.

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply