SQL Server 2008 finally has date and time data types. In this session, we will learn about the details of these new types, how to use them, and some of the not-so-obvious details.
Exploring SQL Server 2008's New Date and Time Features
1. Exploring SQL Server 2008’s New Date and Time Types WebMD Internal – December 3, 2009 Rob Garrison Data Architect, WebMD
2. Speaker Bio Current: Data Architect (OLTP): WebMD Health Services Writer, speaker Past: Columnist: DatabaseJournal.com Corillian (8 years) GemStone (3 years) IT since 1985
3. Caveats Informational Planned for production, but don’t start using until given the go-ahead Features are not Enterprise-only, so expect to use them.
4. Prior to SQL Server 2008 datetime: Date Range: January 1, 1753 - December 31, 9999 Accuracy: rounded to increments of .000, .003, or .007 seconds smalldatetime: Date Range: January 1, 1900, - June 6, 2079 Accuracy: one minute
5. Prior to SQL Server 2008 Assets Limited UTC support Liabilities No date-only No time-only Limited precision Limited date range No time-zone support
6. SQL Server 2008+ date Date only, no time Date Range: January 1, 1 - December 31, 9999 Accuracy: day
7. SQL Server 2008+ time Time only, no date Range: 00:00:00.0000000 - 23:59:59.9999999 Accuracy: variable, down to 100 nanoseconds (0.0000001 seconds)
8. SQL Server 2008+ datetime2 Similar to datetime but better Date Range: January 1, 1 - December 31, 9999 Accuracy: variable, down to 100 nanoseconds
9. Books Online “Use the time, date, datetime2 and datetimeoffset data types for new work. These types align with the SQL Standard. They are more portable. time, datetime2 and datetimeoffset provide more seconds precision. datetimeoffset provides time zone support for globally deployed applications.”