• Jeff Moden (12/22/2011)


    {EDIT} I just noticed and I'm curious... what advantage do you find in maintaining separate DATE and TIME columns?

    Hi Jeff

    The example i posted was an example of a much bigger system, a rota system to track staff bookings for 1600 employees at 150 locations.

    The business requirements was to maintain single day bookings with start and end times.

    When i designed the schema, i had 3 choices (that i could think of anyway),

    Option1 - Store Start and End Time as two DateTime values = DATALENGTH of 18 (including a smallintID)

    Option2 - Store Date and two Time columns with precision 0 = DATALENGTH of 11 (including a smallintID)

    Option3 - Store a start DateTime and an INT for duration = DATALENGTH of 14 (again, including a smallintID)

    as you can see, a Date and 2xTime(0) was the most efficient way to store the data, and it also made querying the data much easier. And also reduced development time on the front-end as i didn't have to worry about getting the user to pick two sets of times and enforce the date part to be the same yada yada.

    And, perhaps most of all, ive never used these data types in a large scale system and was interested to see how they held up, and i must say i am quite impressed so far. Why do you ask anyway? are there some shortfalls i am not aware off?

    Knock Knock, Who's There?, sp underscore, sp underscore who?
    spid1, spid2, spid3....