Date and Time:
With the old datetime data type, SQL Server® users did not have the ability to work with date and time information separately. Four of the new data types—date, time, datetime2, and datetimeoffset—change that, simplifying working with date and time data and providing for increased date range, fractional seconds precision, and time zone support. New database applications should use these new data types instead of the legacy datetime. Let's take a closer look at the new versions.
The date data type stores a date without a time component. The range is from January 1, 1000 though December 31, 9999 (0001-01-01 through 9999-12-31). Each date variable requires 3 bytes of storage and has a precision of 10 digits. The accuracy of the date type is limited to a single day.
The time data type stores the time of day without any date component. It is based on a 24-hour clock, so the supported range is 00:00:00.0000000 through 23:59:59.9999999 (hours, minutes, seconds, and fractional seconds). You can specify the fractional second's precision when the data type is created. The default precision is 7 digits; the accuracy is 100ns. Precision affects how much storage space is required, which can range from 3 bytes for up to 2 digits; 4 bytes for 3 or 4 digits; to 5 bytes for 5 to 7 digits.
The complete article about the same may be viewed at
http://technet.microsoft.com/en-us/magazine/cc434692(TechNet.10).aspx
The time data type stores the time of day without any date component. It is based on a 24-hour clock, so the supported range is 00:00:00.0000000 through 23:59:59.9999999 (hours, minutes, seconds, and fractional seconds). You can specify the fractional second's precision when the data type is created. The default precision is 7 digits; the accuracy is 100ns. Precision affects how much storage space is required, which can range from 3 bytes for up to 2 digits; 4 bytes for 3 or 4 digits; to 5 bytes for 5 to 7 digits.
The complete article about the same may be viewed at
http://technet.microsoft.com/en-us/magazine/cc434692(TechNet.10).aspx
No comments:
Post a Comment