DATE and TIME Data Types in SQL Server 2008
I recently attended the SQLBits V conference where Simon Sabin pointed out the changes to expect when stepping up to SQL Server 2008 from previous versions, most notable for me is the addition of the new DATE and TIME data types. Here’s the full table of types…
Type Storage Scope
DATE 3 bytes 0001-01-01 - 9999-12-31
TIME 3-5 bytes 00:00:00.0000000 - 23:59:59.9999999
SMALLDATETIME 4 bytes 1900-01-01 00:00:00 - 2079-06-06 23:59:59
DATETIME 8 bytes 1753-01-01 00:00:00 - 9999-12-31 23:59:59.997
DATETIME2 6-8 bytes. 0001-01-01 00:00:00 - 9999-12-31 23:59:59.9999999
DATETIMEOFFSET 8-10 bytes 0001-01-01 00:00:00 - 9999-12-31 23:59:59.9999999
-14:00 through +14:00
Categories: Microsoft SQL Server Tags: Data Types, DATE, DATETIME, Microsoft SQL Server, simon sabin, SQL Server, SQLBits, TIME, TSQL
SQLBits V: Highlights from Friday Morning
Having attended the SQL Bits conference in Newport last month I decided to collate the little tips and tricks I learned at the event, here are my highlights from Friday morning’s talks.
Simon Sabin kicked off the talks with a session on SQL Server 2008 Development Features, I’ve not had a good chance to try them out myself since I’m not on 2008 yet but the real highlight is the addition of the DATE and TIME data types – see my other post DATE and TIME Data Types in SQL Server 2008.
Management Studio now includes Intellisense which as been available in Visual Studio for a long time, it will automatically offer suggested keywords as well as table/object names whilst you type and can dramatically speed up your SQL writing. Also new in SSMS is the ability to debug your code and step through it line by line, the debugger will even step into and out of stored procedures and user-defined-functions – this will be a life saver for anyone working with a complex web of SPs.
Following Simon’s talk I headed into the intriguingly names T-SQL Tuning with Colin Chapman, Enzo Ferrari, and The Stig by Brent Ozar – with a title like that how could I not go? The talk turned out to be a great one and Brent’s a very entertaining speaker but all the time you get the feeling that he really knows what it feels like to be a DBA with production issues. Most of my notes from Brent’s talk don’t type-up well but he’s got some excellent resources on his site at http://brentozar.com/go/faster so please do check those out, my personal ‘take homes’ from his talk were to mine the DMVs for performance data, to use mirroring as a way to manage uptime during OS/SQL patch cycles, use a text-file to build a change log on servers and to read the Microsoft whitepaper on index defragmentation.
Categories: Business Intelligence, Events, Microsoft SQL Server Tags: Brent Ozar, conference, DBA, DMV, Microsoft SQL Server, simon sabin, SQL Server, SQLBits


