SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

Similar a 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
 

Similar a 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...
 

Más 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
 

Más 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
 

Último

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusZilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 

Último (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

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/