Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 


October 10, 2008

New Data Types in SQL Server 2008

Learn more about new data types such as DATE and TIME, spatial, and FILESTREAM data types
RSS
Subscribe to Windows IT Pro | See More Products / Software Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!
Main Article    Review: SQL Server 2008

SQL Server 2008 provides a number of useful new data types. These data types include

  • HIERARCHYID: HIERARCHYID is a variable-length system data type that’s designed to address the problem of tracking tree structures such as organization charts. HIERACHYID can store data optimized for either depth or breadth.
  • GEOGRAPHY: The integration of mapping capabilities into many applications makes the new SQL Server 2008 spatial data types, such as GEOGRAPHY, a welcome addition. The GEOGRAPHY data type is a Microsoft .NET Framework–based spatial data type and uses a round-earth model. This data type stores points, lines, polygons, and collections of latitude and longitude coordinates.
  • GEOMETRY: GEOMETRY is another .NET-based and spatial data type. Unlike the GEOGRAPHY type, which is designed primarily for navigation and mapping on a round-earth model, the GEOMETRY data type is Open Geospatial Consortium (OGC) compliant and uses a flat-earth model.
  • DATE: A native SQL data type, the new DATE data type is ANSI compliant and uses the format YYYY-MM-DD. The DATE data type can contain values from 0001-01-01 to 9999-12-31.
  • TIME: Another native SQL data type, TIME complements the new DATE data type. TIME uses an hh:mm:ss[.nnnnnnn] format and can contain values from 00:00:00.0000000 to 23:59.59.9999999.
  • DATETIME2: The DATETIME2 data type addresses the need for more precise date-time storage and is accurate up to 100 nanoseconds. The DATETIME2 data type uses the format YYYY-MM-DD hh:mm:ss[.nnnnnnn] and can store values ranging from 0001-01-01 00:00:00.0000000 through 9999-12-31 23:59.59.9999999.
  • DATETIMEOFFSET: The most advanced of the new date-time data types, DATETIMEOFFSET is like DATETIME2 but is time-zone aware. DATETIMEOFFSET use the format YYYY-MM-DD hh:mm:ss[.nnnnnnn] and can store values ranging from 0001-01-01 00:00:00.0000000 through 9999-12-31 23:59.59.9999999.
  • FILESTREAM: The FILESTREAM data type combines the performance of file-system streaming APIs with the transactional integrity of a relational database. The FILESTREAM data type enables SQL Server to combine unstructured data and is stored in the NTFS file system with the relational database engine. The SQL Server engine manages the link between the FILESTREAM columns and files in the file system, including backing up and restoring file system data.

End of Article



Reader Comments

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

WinInfo Short Takes: Week of November 9, 2009

An often irreverent look at some of the week's other news, including some more Windows 7 sales momentum, some Sophos stupidity, Microsoft's cloud computing self-loathing, more whining from the browser makers, Zoho's "Fake Office," and much, much more ...

Understanding File-Size Limits on NTFS and FAT

A general confusion about files sizes on FAT seems to stem from FAT32's file-size limit of 4GB and partition-size limit of 2TB. ...


Related Events SQL Server Unleashed EMEA

DevConnections, Microsoft® ASP.NET Connections, SharePoint Connections and SQL Server Connections

24 Hours of PASS

Check out our list of Free Email Newsletters!

SQL Server and Database eBooks Safeguarding Your Windows Servers

SQL Server Administration for Oracle DBAs

Taking Control: Monitoring the Windows Platform Proactively

Related SQL Server and Database Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement