SlideShare une entreprise Scribd logo
1  sur  23
Introduction to the New Data
  Types in SQL Server 2008


                      Sarah Dutkiewicz
             sarah@codinggeekette.com
New Types in SQL 2008




               HIERARCHICAL   GEOSPATIAL   FILESTREAM
DATE/TIME
New Date/Time Data Types
                    DATETIME

              2008-08-28 12:32:54.720


    DATE                                 TIME

 2008-08-28                        12:32:54.720


                   DATETIME2

           2008-08-28 12:32:54.7214690


                 DATETIMEOFFSET

      2008-08-28 12:32:54.7214690 -04:00
DATETIME vs DATETIME2

           DATETIME                     DATETIME2
           2008-08-28 12:32:54.720      2008-08-28 12:32:54.7214690

Accuracy   333 ns                       100 ns
Range      1753/01/01-9999/12/31        0001/01/01 – 9999/12/31

                                        6-8 bytes*
Storage    8 bytes




                           *6 bytes for precisions less than 3; 7 bytes for
                           precisions 4 and 5. All other precisions require
                           8 bytes. The default precision is 7.
DATETIMEOFFSET

       DATETIME2                                                    OFFSET

2008-08-28 12:32:54.7214690                                          -04:00




                                        DATETIMEOFFSET

                              2008-08-28 12:32:54.7214690 -04:00


                                DATETIMEOFFSET is stored in 10 bytes – 8 bytes for
                                the DATETIME2 part and 2 bytes for the OFFSET.

                                The offset is based on the UTC and is not fully time-
                                zone aware.
New DATETIME Functions
Function              Example                          Return Datatype


GETDATE()             2008-08-28 12:32:54.720          DATETIME
GETUTCDATE()          2008-08-28 16:32:54.720          DATETIME
SYSDATETIME()         2008-08-28 12:32:54.7214690      DATETIME2
SYSUTCDATETIME()      2008-08-28 16:32:54.7214690      DATETIME2

SYSDATETIMEOFFSET()   2008-08-28 12:32:54.7214690 -04:00 DATETIMEOFFSET
HIERARCHYID

A data type to store hierarchical representations.

Not limited to organizational charts. Other ideas include:
HIERARCHYID Considerations
Provides storage and methods to work with hierarchical data


Indexes are handled in depth-first but can also be set up breadth-first.


Does NOT enforce relationships – that is left for the application


Does NOT enforce uniqueness


No guidance for creating hierarchies – hierarchyid values need to be
assigned at the application level.
HIERARCHYID Methods
           • Parse
Display    • ToString




           •   GetRoot
           •   GetAncestor
Position   •   GetDescendant
           •   IsDescendant
           •   GetLevel
HIERARCHYID Representation

    PositionID     Path                 PositionTitle

1   0x             /                    President

2   0x58           /1/                  Treasurer


Methods
                       • Parse – returns the PositionID (binary data)
         Display         representation
                       • ToString – returns the Path (human readable)
                         representation
HIERARCHYID Demo

                                           President (/)



                  Speakers Lead   Sponsors Lead      Venue Lead   Volunteers
Treasurer (/1/)                                                                    Swag Lead (/6/)
                      (/2/)           (/3/)             (/4/)     Lead (/5/)


                                                                     Volunteer 1      Book Publishers
                                                                       (/5/1/)        Contact (/6/1/)


                                                                     Volunteer 2         Software
                                                                       (/5/2/)         Contact (/6/2/)


                                                                     Volunteer 3
                                                                       (/5/3/)
Isn’t that Spatial?




GEOGRAPHY            GEOMETRY
GEOGRAPHY vs GEOMETRY

Great for location-tracking and other mapping applications!

            GEOGRAPHY                   GEOMETRY

Standards   WGS84 (GPS) and Open        Well-Known Text (WKT)
            Geospatial Consortium       Well-Known Binary (WKB)
            standards (WKT, WKB, GML)   Geographic Markup Language
                                        (GML)
Type        Geodetic (Round Earth)      Planar
Geospatial Demos




Round Earth    Planar Coordinates
Coordinates
FILESTREAM
FILESTREAM Instead of BLOB

                      BLOB                  FILESTREAM


Storage               In Database           In NTFS filesystem
Filestreaming         Slow due to storage   Quicker, using NTFS
                                            streaming APIs
Caching               Uses SQL caching      Uses Windows caching
FILESTREAM Setup
  Enable FILESTREAM at the
        Instance level




      Create filegroup




       Create table with
   varbinary(max) column
  with FILESTREAM attribute
FILESTREAM Advantages

Allows association of unstructured files to structured data

Uses Windows APIs and cache, making it better performance-wise for
streaming than from a BLOB for larger files

SQL backup and recovery models support these files

Can use SQL queries to work with the unstructured files

FILESTREAM data is protected by SQL permissions
FILESTREAM Disadvantages

No current support for in-place updates.

 quot;Updatesquot; to columns with FILESTREAM create new files and then
 change the file pointer.

 Old file is deleted at garbage collection – log backup, database
 backup, or checkpoint for simple recovery.
FILESTREAM Limitations

Databases with FILESTREAM data cannot be configured for database
mirroring.

Database snapshots are not supported for FILESTREAM data.

Native encryption is not possible by SQL SERVER for FILESTREAM data.
More SQL Server Presentations
• quot;Query Tuning in SQL Server 2005 and 2005quot;
  by Chris Barth
• quot;SQL Server Service Brokerquot; by Josef Finsel
• quot;Automating SQL Server Administrative Tasks
  with PowerShellquot; by Allen White
• quot;Test Driven Development for TSQLquot; by Phil
  Japikse
Resources
• SQL Server 2008 Books Online:
  http://msdn.microsoft.com/en-
  gb/library/ms130214.aspx
• SQL Server Express WebLog:
  http://blogs.msdn.com/sqlexpress/
• Sample SQL 2008 Databases:
  http://www.codeplex.com/MSFTDBProdSamples/Relea
  se/ProjectReleases.aspx
• Jason Follas’ series on Spatial Data:
  http://tinyurl.com/spatialdataseries
• Open Geospatial Consortium:
  http://www.opengeospatial.org/
Contact Information


Blog: http://www.codinggeekette.com
Email: sarah@codinggeekette.com

Contenu connexe

Similaire à Intro to the New Data Types in SQL 2008

Data exchange alternatives, SBIS conference in Stockholm (2008)
Data exchange alternatives, SBIS conference in Stockholm (2008)Data exchange alternatives, SBIS conference in Stockholm (2008)
Data exchange alternatives, SBIS conference in Stockholm (2008)Dag Endresen
 
FAQ on Dedupe NetApp
FAQ on Dedupe NetAppFAQ on Dedupe NetApp
FAQ on Dedupe NetAppAshwin Pawar
 
Using spider for sharding in production
Using spider for sharding in productionUsing spider for sharding in production
Using spider for sharding in productionKentoku
 
Introduction to MapReduce Data Transformations
Introduction to MapReduce Data TransformationsIntroduction to MapReduce Data Transformations
Introduction to MapReduce Data Transformationsswooledge
 
Intro to Hadoop
Intro to HadoopIntro to Hadoop
Intro to Hadoopjeffturner
 
Whats New At Qad(8.6toe B2.1)
Whats New At Qad(8.6toe B2.1)Whats New At Qad(8.6toe B2.1)
Whats New At Qad(8.6toe B2.1)shashikantgp
 
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォームPivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォームMasayuki Matsushita
 
Google_A_Behind_the_Scenes_Tour_-_Jeff_Dean
Google_A_Behind_the_Scenes_Tour_-_Jeff_DeanGoogle_A_Behind_the_Scenes_Tour_-_Jeff_Dean
Google_A_Behind_the_Scenes_Tour_-_Jeff_DeanHiroshi Ono
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataSafe Software
 
Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesBobby Curtis
 
Facebook's Approach to Big Data Storage Challenge
Facebook's Approach to Big Data Storage ChallengeFacebook's Approach to Big Data Storage Challenge
Facebook's Approach to Big Data Storage ChallengeDataWorks Summit
 
DHT2 - O Brother, Where Art Thou with Shyam Ranganathan
DHT2 - O Brother, Where Art Thou with 	Shyam RanganathanDHT2 - O Brother, Where Art Thou with 	Shyam Ranganathan
DHT2 - O Brother, Where Art Thou with Shyam RanganathanGluster.org
 
Hive ICDE 2010
Hive ICDE 2010Hive ICDE 2010
Hive ICDE 2010ragho
 
HIVE: Data Warehousing & Analytics on Hadoop
HIVE: Data Warehousing & Analytics on HadoopHIVE: Data Warehousing & Analytics on Hadoop
HIVE: Data Warehousing & Analytics on HadoopZheng Shao
 
Large scale preservation workflows with Taverna – SCAPE Training event, Guima...
Large scale preservation workflows with Taverna – SCAPE Training event, Guima...Large scale preservation workflows with Taverna – SCAPE Training event, Guima...
Large scale preservation workflows with Taverna – SCAPE Training event, Guima...SCAPE Project
 

Similaire à Intro to the New Data Types in SQL 2008 (20)

CouchDB
CouchDBCouchDB
CouchDB
 
Handling Big Data
Handling Big DataHandling Big Data
Handling Big Data
 
Data exchange alternatives, SBIS conference in Stockholm (2008)
Data exchange alternatives, SBIS conference in Stockholm (2008)Data exchange alternatives, SBIS conference in Stockholm (2008)
Data exchange alternatives, SBIS conference in Stockholm (2008)
 
Glasgow University Geo Metadata Workshop
Glasgow University Geo Metadata WorkshopGlasgow University Geo Metadata Workshop
Glasgow University Geo Metadata Workshop
 
FAQ on Dedupe NetApp
FAQ on Dedupe NetAppFAQ on Dedupe NetApp
FAQ on Dedupe NetApp
 
Using spider for sharding in production
Using spider for sharding in productionUsing spider for sharding in production
Using spider for sharding in production
 
Introduction to MapReduce Data Transformations
Introduction to MapReduce Data TransformationsIntroduction to MapReduce Data Transformations
Introduction to MapReduce Data Transformations
 
Intro to Hadoop
Intro to HadoopIntro to Hadoop
Intro to Hadoop
 
ΥΛΗ_ΕΠΑΛ_Γ_2223.pdf
ΥΛΗ_ΕΠΑΛ_Γ_2223.pdfΥΛΗ_ΕΠΑΛ_Γ_2223.pdf
ΥΛΗ_ΕΠΑΛ_Γ_2223.pdf
 
Whats New At Qad(8.6toe B2.1)
Whats New At Qad(8.6toe B2.1)Whats New At Qad(8.6toe B2.1)
Whats New At Qad(8.6toe B2.1)
 
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォームPivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
Pivotal Greenplum 次世代マルチクラウド・データ分析プラットフォーム
 
Google_A_Behind_the_Scenes_Tour_-_Jeff_Dean
Google_A_Behind_the_Scenes_Tour_-_Jeff_DeanGoogle_A_Behind_the_Scenes_Tour_-_Jeff_Dean
Google_A_Behind_the_Scenes_Tour_-_Jeff_Dean
 
Deep Dive on Amazon Redshift
Deep Dive on Amazon RedshiftDeep Dive on Amazon Redshift
Deep Dive on Amazon Redshift
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
 
Examining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail FilesExamining Oracle GoldenGate Trail Files
Examining Oracle GoldenGate Trail Files
 
Facebook's Approach to Big Data Storage Challenge
Facebook's Approach to Big Data Storage ChallengeFacebook's Approach to Big Data Storage Challenge
Facebook's Approach to Big Data Storage Challenge
 
DHT2 - O Brother, Where Art Thou with Shyam Ranganathan
DHT2 - O Brother, Where Art Thou with 	Shyam RanganathanDHT2 - O Brother, Where Art Thou with 	Shyam Ranganathan
DHT2 - O Brother, Where Art Thou with Shyam Ranganathan
 
Hive ICDE 2010
Hive ICDE 2010Hive ICDE 2010
Hive ICDE 2010
 
HIVE: Data Warehousing & Analytics on Hadoop
HIVE: Data Warehousing & Analytics on HadoopHIVE: Data Warehousing & Analytics on Hadoop
HIVE: Data Warehousing & Analytics on Hadoop
 
Large scale preservation workflows with Taverna – SCAPE Training event, Guima...
Large scale preservation workflows with Taverna – SCAPE Training event, Guima...Large scale preservation workflows with Taverna – SCAPE Training event, Guima...
Large scale preservation workflows with Taverna – SCAPE Training event, Guima...
 

Plus de Sarah Dutkiewicz

Passwordless Development using Azure Identity
Passwordless Development using Azure IdentityPasswordless Development using Azure Identity
Passwordless Development using Azure IdentitySarah Dutkiewicz
 
Predicting Flights with Azure Databricks
Predicting Flights with Azure DatabricksPredicting Flights with Azure Databricks
Predicting Flights with Azure DatabricksSarah Dutkiewicz
 
Azure DevOps for Developers
Azure DevOps for DevelopersAzure DevOps for Developers
Azure DevOps for DevelopersSarah Dutkiewicz
 
Azure DevOps for JavaScript Developers
Azure DevOps for JavaScript DevelopersAzure DevOps for JavaScript Developers
Azure DevOps for JavaScript DevelopersSarah Dutkiewicz
 
Azure DevOps for the Data Professional
Azure DevOps for the Data ProfessionalAzure DevOps for the Data Professional
Azure DevOps for the Data ProfessionalSarah Dutkiewicz
 
Noodling with Data in Jupyter Notebook
Noodling with Data in Jupyter NotebookNoodling with Data in Jupyter Notebook
Noodling with Data in Jupyter NotebookSarah Dutkiewicz
 
Intro to Python for C# Developers
Intro to Python for C# DevelopersIntro to Python for C# Developers
Intro to Python for C# DevelopersSarah Dutkiewicz
 
Introduction to Testing and TDD
Introduction to Testing and TDDIntroduction to Testing and TDD
Introduction to Testing and TDDSarah Dutkiewicz
 
Becoming a Servant Leader, Leading from the Trenches
Becoming a Servant Leader, Leading from the TrenchesBecoming a Servant Leader, Leading from the Trenches
Becoming a Servant Leader, Leading from the TrenchesSarah Dutkiewicz
 
NEOISF - On Mentoring Future Techies
NEOISF - On Mentoring Future TechiesNEOISF - On Mentoring Future Techies
NEOISF - On Mentoring Future TechiesSarah Dutkiewicz
 
The Polyglot Data Scientist - Exploring R, Python, and SQL Server
The Polyglot Data Scientist - Exploring R, Python, and SQL ServerThe Polyglot Data Scientist - Exploring R, Python, and SQL Server
The Polyglot Data Scientist - Exploring R, Python, and SQL ServerSarah Dutkiewicz
 
The importance of UX for Developers
The importance of UX for DevelopersThe importance of UX for Developers
The importance of UX for DevelopersSarah Dutkiewicz
 
The Impact of Women Trailblazers in Tech
The Impact of Women Trailblazers in TechThe Impact of Women Trailblazers in Tech
The Impact of Women Trailblazers in TechSarah Dutkiewicz
 
Unstoppable Course Final Presentation
Unstoppable Course Final PresentationUnstoppable Course Final Presentation
Unstoppable Course Final PresentationSarah Dutkiewicz
 
Even More Tools for the Developer's UX Toolbelt
Even More Tools for the Developer's UX ToolbeltEven More Tools for the Developer's UX Toolbelt
Even More Tools for the Developer's UX ToolbeltSarah Dutkiewicz
 
History of Women in Tech - Trivia
History of Women in Tech - TriviaHistory of Women in Tech - Trivia
History of Women in Tech - TriviaSarah Dutkiewicz
 
The UX Toolbelt for Developers
The UX Toolbelt for DevelopersThe UX Toolbelt for Developers
The UX Toolbelt for DevelopersSarah Dutkiewicz
 

Plus de Sarah Dutkiewicz (20)

Passwordless Development using Azure Identity
Passwordless Development using Azure IdentityPasswordless Development using Azure Identity
Passwordless Development using Azure Identity
 
Predicting Flights with Azure Databricks
Predicting Flights with Azure DatabricksPredicting Flights with Azure Databricks
Predicting Flights with Azure Databricks
 
Azure DevOps for Developers
Azure DevOps for DevelopersAzure DevOps for Developers
Azure DevOps for Developers
 
Azure DevOps for JavaScript Developers
Azure DevOps for JavaScript DevelopersAzure DevOps for JavaScript Developers
Azure DevOps for JavaScript Developers
 
Azure DevOps for the Data Professional
Azure DevOps for the Data ProfessionalAzure DevOps for the Data Professional
Azure DevOps for the Data Professional
 
Noodling with Data in Jupyter Notebook
Noodling with Data in Jupyter NotebookNoodling with Data in Jupyter Notebook
Noodling with Data in Jupyter Notebook
 
Pairing and mobbing
Pairing and mobbingPairing and mobbing
Pairing and mobbing
 
Intro to Python for C# Developers
Intro to Python for C# DevelopersIntro to Python for C# Developers
Intro to Python for C# Developers
 
Introduction to Testing and TDD
Introduction to Testing and TDDIntroduction to Testing and TDD
Introduction to Testing and TDD
 
Becoming a Servant Leader, Leading from the Trenches
Becoming a Servant Leader, Leading from the TrenchesBecoming a Servant Leader, Leading from the Trenches
Becoming a Servant Leader, Leading from the Trenches
 
NEOISF - On Mentoring Future Techies
NEOISF - On Mentoring Future TechiesNEOISF - On Mentoring Future Techies
NEOISF - On Mentoring Future Techies
 
Becoming a Servant Leader
Becoming a Servant LeaderBecoming a Servant Leader
Becoming a Servant Leader
 
The Polyglot Data Scientist - Exploring R, Python, and SQL Server
The Polyglot Data Scientist - Exploring R, Python, and SQL ServerThe Polyglot Data Scientist - Exploring R, Python, and SQL Server
The Polyglot Data Scientist - Exploring R, Python, and SQL Server
 
The importance of UX for Developers
The importance of UX for DevelopersThe importance of UX for Developers
The importance of UX for Developers
 
The Impact of Women Trailblazers in Tech
The Impact of Women Trailblazers in TechThe Impact of Women Trailblazers in Tech
The Impact of Women Trailblazers in Tech
 
Unstoppable Course Final Presentation
Unstoppable Course Final PresentationUnstoppable Course Final Presentation
Unstoppable Course Final Presentation
 
Even More Tools for the Developer's UX Toolbelt
Even More Tools for the Developer's UX ToolbeltEven More Tools for the Developer's UX Toolbelt
Even More Tools for the Developer's UX Toolbelt
 
History of Women in Tech
History of Women in TechHistory of Women in Tech
History of Women in Tech
 
History of Women in Tech - Trivia
History of Women in Tech - TriviaHistory of Women in Tech - Trivia
History of Women in Tech - Trivia
 
The UX Toolbelt for Developers
The UX Toolbelt for DevelopersThe UX Toolbelt for Developers
The UX Toolbelt for Developers
 

Dernier

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Dernier (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

Intro to the New Data Types in SQL 2008

  • 1. Introduction to the New Data Types in SQL Server 2008 Sarah Dutkiewicz sarah@codinggeekette.com
  • 2. New Types in SQL 2008 HIERARCHICAL GEOSPATIAL FILESTREAM DATE/TIME
  • 3. New Date/Time Data Types DATETIME 2008-08-28 12:32:54.720 DATE TIME 2008-08-28 12:32:54.720 DATETIME2 2008-08-28 12:32:54.7214690 DATETIMEOFFSET 2008-08-28 12:32:54.7214690 -04:00
  • 4. DATETIME vs DATETIME2 DATETIME DATETIME2 2008-08-28 12:32:54.720 2008-08-28 12:32:54.7214690 Accuracy 333 ns 100 ns Range 1753/01/01-9999/12/31 0001/01/01 – 9999/12/31 6-8 bytes* Storage 8 bytes *6 bytes for precisions less than 3; 7 bytes for precisions 4 and 5. All other precisions require 8 bytes. The default precision is 7.
  • 5. DATETIMEOFFSET DATETIME2 OFFSET 2008-08-28 12:32:54.7214690 -04:00 DATETIMEOFFSET 2008-08-28 12:32:54.7214690 -04:00 DATETIMEOFFSET is stored in 10 bytes – 8 bytes for the DATETIME2 part and 2 bytes for the OFFSET. The offset is based on the UTC and is not fully time- zone aware.
  • 6. New DATETIME Functions Function Example Return Datatype GETDATE() 2008-08-28 12:32:54.720 DATETIME GETUTCDATE() 2008-08-28 16:32:54.720 DATETIME SYSDATETIME() 2008-08-28 12:32:54.7214690 DATETIME2 SYSUTCDATETIME() 2008-08-28 16:32:54.7214690 DATETIME2 SYSDATETIMEOFFSET() 2008-08-28 12:32:54.7214690 -04:00 DATETIMEOFFSET
  • 7. HIERARCHYID A data type to store hierarchical representations. Not limited to organizational charts. Other ideas include:
  • 8. HIERARCHYID Considerations Provides storage and methods to work with hierarchical data Indexes are handled in depth-first but can also be set up breadth-first. Does NOT enforce relationships – that is left for the application Does NOT enforce uniqueness No guidance for creating hierarchies – hierarchyid values need to be assigned at the application level.
  • 9. HIERARCHYID Methods • Parse Display • ToString • GetRoot • GetAncestor Position • GetDescendant • IsDescendant • GetLevel
  • 10. HIERARCHYID Representation PositionID Path PositionTitle 1 0x / President 2 0x58 /1/ Treasurer Methods • Parse – returns the PositionID (binary data) Display representation • ToString – returns the Path (human readable) representation
  • 11. HIERARCHYID Demo President (/) Speakers Lead Sponsors Lead Venue Lead Volunteers Treasurer (/1/) Swag Lead (/6/) (/2/) (/3/) (/4/) Lead (/5/) Volunteer 1 Book Publishers (/5/1/) Contact (/6/1/) Volunteer 2 Software (/5/2/) Contact (/6/2/) Volunteer 3 (/5/3/)
  • 13. GEOGRAPHY vs GEOMETRY Great for location-tracking and other mapping applications! GEOGRAPHY GEOMETRY Standards WGS84 (GPS) and Open Well-Known Text (WKT) Geospatial Consortium Well-Known Binary (WKB) standards (WKT, WKB, GML) Geographic Markup Language (GML) Type Geodetic (Round Earth) Planar
  • 14. Geospatial Demos Round Earth Planar Coordinates Coordinates
  • 16. FILESTREAM Instead of BLOB BLOB FILESTREAM Storage In Database In NTFS filesystem Filestreaming Slow due to storage Quicker, using NTFS streaming APIs Caching Uses SQL caching Uses Windows caching
  • 17. FILESTREAM Setup Enable FILESTREAM at the Instance level Create filegroup Create table with varbinary(max) column with FILESTREAM attribute
  • 18. FILESTREAM Advantages Allows association of unstructured files to structured data Uses Windows APIs and cache, making it better performance-wise for streaming than from a BLOB for larger files SQL backup and recovery models support these files Can use SQL queries to work with the unstructured files FILESTREAM data is protected by SQL permissions
  • 19. FILESTREAM Disadvantages No current support for in-place updates. quot;Updatesquot; to columns with FILESTREAM create new files and then change the file pointer. Old file is deleted at garbage collection – log backup, database backup, or checkpoint for simple recovery.
  • 20. FILESTREAM Limitations Databases with FILESTREAM data cannot be configured for database mirroring. Database snapshots are not supported for FILESTREAM data. Native encryption is not possible by SQL SERVER for FILESTREAM data.
  • 21. More SQL Server Presentations • quot;Query Tuning in SQL Server 2005 and 2005quot; by Chris Barth • quot;SQL Server Service Brokerquot; by Josef Finsel • quot;Automating SQL Server Administrative Tasks with PowerShellquot; by Allen White • quot;Test Driven Development for TSQLquot; by Phil Japikse
  • 22. Resources • SQL Server 2008 Books Online: http://msdn.microsoft.com/en- gb/library/ms130214.aspx • SQL Server Express WebLog: http://blogs.msdn.com/sqlexpress/ • Sample SQL 2008 Databases: http://www.codeplex.com/MSFTDBProdSamples/Relea se/ProjectReleases.aspx • Jason Follas’ series on Spatial Data: http://tinyurl.com/spatialdataseries • Open Geospatial Consortium: http://www.opengeospatial.org/