Home Forums SQL Server 2005 T-SQL (SS2K5) Advantage of using date and time in 2008 over 2005 datetime RE: Advantage of using date and time in 2008 over 2005 datetime

  • 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