SlideShare a Scribd company logo
Sqlserver 2008 R2 Kashif Akram
New Datatypes Agenda  Datatypes CRL  Reporting Services
Datetime DATE: As you can imagine, the DATE data type only stores a date in the format of YYYY-MM-DD. It has a range of 0001-01-01 through 9999-12-32, which should be adequate for most business and scientific applications. The accuracy is 1 day, and it only takes 3 bytes to store the date. TIME: TIME is stored in the format: hh:mm:ss.nnnnnnn, with a range of 00:00:00.0000000 through 23:59:59:9999999 and is accurate to 100 nanoseconds. Storage depends on the precision and scale selected, and runs from 3 to 5 bytes.
DECLARE @d DATE   SET @d = GETDATE()   SELECT @d -- outputs '2008-04-06 '   SET @d = '1234-03-22 11:25:09'   SELECT @d  -- outputs '1234-03-22  '
CREATE TABLE #times(       T   TIME,       T1  TIME(1),       T5  TIME(5),       T7  TIME(7)       )   INSERT INTO #times VALUES (       '01:02:03.1234567',       '01:02:03.1234567',       '01:02:03.1234567',       '01:02:03.1234567')   SELECT * FROM #times   T                T1               T5               T7   ---------------- ---------------- ---------------- ----------------   01:02:03.1234567 01:02:03.1000000 01:02:03.1234600 01:02:03.1234567
DATETIME2: DATETIME2 is very similar to the older DATETIME data type, but has a greater range and precision. The format is YYYY-MM-DD hh:mm:ss:nnnnnnnm with a range of 0001-01-01 00:00:00.0000000 through 9999-12-31 23:59:59.9999999, and an accuracy of 100 nanoseconds. Storage depends on the precision and scale selected, and runs from 6 to 8 bytes. DATETIMEOFFSET: DATETIMEOFFSET is similar to DATETIME2, but includes additional information to track the time zone. The format is YYYY-MM-DD hh:mm:ss[.nnnnnnn] [+|-]hh:mm with a range of 0001-01-01 00:00:00.0000000 through 0001-01-01 00:00:00.0000000 through 9999-12-31 23:59:59.9999999 (in UTC), and an accuracy of 100 nanoseconds. Storage depends on the precision and scale selected, and runs from 8 to 10 bytes.
DECLARE @dateA DATETIME2 = '2008-04-05 01:02:03.12345'   PRINT @dateA -- outputs 2008-04-05 01:02:03.1234500   DECLARE @dateB DATETIME2(4) = '2008-04-05 01:02:03.12345'   PRINT @dateB -- outputs 2008-04-05 01:02:03.1235
DECLARE @today DATETIMEOFFSET = '2008-04-05T01:02:03.1234567-05:00'   PRINT @today -- outputs 2008-04-05 01:02:03.1234567 -05:00   DECLARE @today2 DATETIMEOFFSET(2) = '2008-04-05T01:02:03.1234567-05:00'   PRINT @today2 -- outputs 2008-04-05 01:02:03.12 -05:00
Spatial GEOMETRY: The GEOMETRY data type is used to store planar (flat-earth) data. It is generally used to store XY coordinates that represent points, lines, and polygons in a two-dimensional space. For example storing XY coordinates in the GEOMETRY data type can be used to map the exterior of a building. GEOGRAPHY: The GEOGRAPHY data type is used to store ellipsoidal (round-earth) data. It is used to store latitude and longitude coordinates that represent points, lines, and polygons on the earth’s surface. For example, GPS data that represents the lay of the land is one example of data that can be stored in theGEOGRAPHY data type.
DECLARE @shape geometry   SET @shape = geometry::STPolyFromText('POLYGON ((                    47.653 -122.358,                     47.653 -122.354,                     47.657 -122.354,                     47.653 -122.350,                     47.645 -122.350,                     ... (snip)                    47.651 -122.355,                     47.653 -122.358))',  0)
SELECT @shape.STEnvelope().ToString()   -- outputs something like   /*    POLYGON ((        47.657 -122.358,       47.657 -122.350,       47.645 -122.350,       47.645 -122.358,       47.657 -122.358))   */
HIERARCHYID Organizational structures A set of tasks that make up a larger projects (like a GANTT chart) File systems (folders and their sub-folders) A classification of language terms A bill of materials to assemble or build a product A graphical representation of links between web pages
CREATE TABLE #Categories (   CategoryID INT IDENTITY(1,1),   CategoryNode HIERARCHYID NOT NULL,   CategName NVARCHAR(40) NOT NULL       )
DECLARE @root HIERARCHYID = hierarchyid::GetRoot()   INSERT INTO #Categories (CategoryNode, CategName)        VALUES (@root, 'All #Categories')   -- insert the 'Electronics' category   DECLARE @electronics HIERARCHYID   SELECT @electronics = @root.GetDescendant(NULL, NULL)   INSERT INTO #Categories (CategoryNode, CategName)        VALUES (@electronics, 'Electronics')   -- insert the 'Music' category after 'Electronics'   DECLARE @music HIERARCHYID   SELECT @music = @root.GetDescendant(NULL, @electronics)   INSERT INTO #Categories (CategoryNode, CategName)        VALUES (@music, 'Music')
-- insert the 'Apparel' category between 'Electronics' and 'Music'   SELECT @music = @root.GetDescendant(@music, @electronics)   INSERT INTO #Categories (CategoryNode, CategName)        VALUES (@music, 'Apparel')   -- insert some children under 'Electronics'   DECLARE @video HIERARCHYID   --   We could do a simple @category.GetDescendant() but, let's   --      show something that is more likely to happen   SELECT @video = CategoryNode.GetDescendant(NULL, NULL)     FROM #Categories WHERE CategName ='Electronics'   INSERT INTO #Categories (CategoryNode, CategName)        VALUES (@video, 'Video Equipment')   -- insert some children under 'Video Equipment'   DECLARE @tvs HIERARCHYID   SELECT @tvs = @video.GetDescendant(NULL, NULL)   INSERT INTO #Categories (CategoryNode, CategName)        VALUES (@tvs, 'Televisions')   DECLARE @players HIERARCHYID   SELECT @players = @video.GetDescendant(NULL, @tvs)   INSERT INTO #Categories (CategoryNode, CategName)        VALUES (@players, 'DVD - BluRay')
SELECT    CategoryID, CategName,    CategoryNode,    CategoryNode.ToString() AS Path   FROM #Categories
FILESTREAM Transact-SQL can be used to SELECT, INSERT, UPDATE, DELETE FILESTREAM data. By default, FILESTREAM data is backed up and restored as part of the database file. If you want, there is an option available so you can backup a database without the FILESTREAM data. The size of the stored data is only limited by the available space of the file system. Standard VARBINARY(MAX) data is limited to 2 GB.
USE Production; GO CREATE TABLE DocumentStore ( DocumentID INT IDENTITY PRIMARY KEY,        Document VARBINARY (MAX) FILESTREAM NULL, DocGUID UNIQUEIDENTIFIER NOT NULL ROWGUIDCOL               UNIQUE DEFAULT NEWID ()) FILESTREAM_ON FileStreamGroup1; GO
CLR EXEC sp_configure 'clr enabled', '1' reconfigure
Sqlserver 2008 r2
Sqlserver 2008 r2

More Related Content

What's hot

Introduction to R
Introduction to RIntroduction to R
Introduction to R
Sander Kieft
 
Cassandra model
Cassandra modelCassandra model
Cassandra model
zqhxuyuan
 
Grouping & Summarizing Data in R
Grouping & Summarizing Data in RGrouping & Summarizing Data in R
Grouping & Summarizing Data in R
Jeffrey Breen
 
Data Clustering with R
Data Clustering with RData Clustering with R
Data Clustering with R
Yanchang Zhao
 
Introduction to data.table in R
Introduction to data.table in RIntroduction to data.table in R
Introduction to data.table in R
Paul Richards
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyr
Romain Francois
 
3 pandasadvanced
3 pandasadvanced3 pandasadvanced
3 pandasadvanced
pramod naik
 
Sharbani bhattacharya sacta 2014
Sharbani bhattacharya sacta 2014Sharbani bhattacharya sacta 2014
Sharbani bhattacharya sacta 2014
Sharbani Bhattacharya
 
Pemrograman Terstruktur 4
Pemrograman Terstruktur 4Pemrograman Terstruktur 4
Pemrograman Terstruktur 4
Moch Mifthachul M
 
Day 4a iteration and functions.pptx
Day 4a   iteration and functions.pptxDay 4a   iteration and functions.pptx
Day 4a iteration and functions.pptx
Adrien Melquiond
 
Day 4b iteration and functions for-loops.pptx
Day 4b   iteration and functions  for-loops.pptxDay 4b   iteration and functions  for-loops.pptx
Day 4b iteration and functions for-loops.pptx
Adrien Melquiond
 
R gráfico
R gráficoR gráfico
R gráfico
stryper1968
 
Mysqlfunctions
MysqlfunctionsMysqlfunctions
Mysqlfunctions
N13M
 
Big Data Mining in Indian Economic Survey 2017
Big Data Mining in Indian Economic Survey 2017Big Data Mining in Indian Economic Survey 2017
Big Data Mining in Indian Economic Survey 2017
Parth Khare
 
CLUSTERGRAM
CLUSTERGRAMCLUSTERGRAM
CLUSTERGRAM
Dr. Volkan OBAN
 
Oracle sql ppt1
Oracle sql ppt1Oracle sql ppt1
Oracle sql ppt1
Madhavendra Dutt
 
Stata cheat sheet: data transformation
Stata  cheat sheet: data transformationStata  cheat sheet: data transformation
Stata cheat sheet: data transformation
Tim Essam
 
RDataMining slides-data-exploration-visualisation
RDataMining slides-data-exploration-visualisationRDataMining slides-data-exploration-visualisation
RDataMining slides-data-exploration-visualisation
Yanchang Zhao
 
11. Linear Models
11. Linear Models11. Linear Models
11. Linear Models
FAO
 
Stata cheat sheet: data processing
Stata cheat sheet: data processingStata cheat sheet: data processing
Stata cheat sheet: data processing
Tim Essam
 

What's hot (20)

Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Cassandra model
Cassandra modelCassandra model
Cassandra model
 
Grouping & Summarizing Data in R
Grouping & Summarizing Data in RGrouping & Summarizing Data in R
Grouping & Summarizing Data in R
 
Data Clustering with R
Data Clustering with RData Clustering with R
Data Clustering with R
 
Introduction to data.table in R
Introduction to data.table in RIntroduction to data.table in R
Introduction to data.table in R
 
Data manipulation with dplyr
Data manipulation with dplyrData manipulation with dplyr
Data manipulation with dplyr
 
3 pandasadvanced
3 pandasadvanced3 pandasadvanced
3 pandasadvanced
 
Sharbani bhattacharya sacta 2014
Sharbani bhattacharya sacta 2014Sharbani bhattacharya sacta 2014
Sharbani bhattacharya sacta 2014
 
Pemrograman Terstruktur 4
Pemrograman Terstruktur 4Pemrograman Terstruktur 4
Pemrograman Terstruktur 4
 
Day 4a iteration and functions.pptx
Day 4a   iteration and functions.pptxDay 4a   iteration and functions.pptx
Day 4a iteration and functions.pptx
 
Day 4b iteration and functions for-loops.pptx
Day 4b   iteration and functions  for-loops.pptxDay 4b   iteration and functions  for-loops.pptx
Day 4b iteration and functions for-loops.pptx
 
R gráfico
R gráficoR gráfico
R gráfico
 
Mysqlfunctions
MysqlfunctionsMysqlfunctions
Mysqlfunctions
 
Big Data Mining in Indian Economic Survey 2017
Big Data Mining in Indian Economic Survey 2017Big Data Mining in Indian Economic Survey 2017
Big Data Mining in Indian Economic Survey 2017
 
CLUSTERGRAM
CLUSTERGRAMCLUSTERGRAM
CLUSTERGRAM
 
Oracle sql ppt1
Oracle sql ppt1Oracle sql ppt1
Oracle sql ppt1
 
Stata cheat sheet: data transformation
Stata  cheat sheet: data transformationStata  cheat sheet: data transformation
Stata cheat sheet: data transformation
 
RDataMining slides-data-exploration-visualisation
RDataMining slides-data-exploration-visualisationRDataMining slides-data-exploration-visualisation
RDataMining slides-data-exploration-visualisation
 
11. Linear Models
11. Linear Models11. Linear Models
11. Linear Models
 
Stata cheat sheet: data processing
Stata cheat sheet: data processingStata cheat sheet: data processing
Stata cheat sheet: data processing
 

Similar to Sqlserver 2008 r2

Oracle to Cassandra Core Concepts Guide Pt. 2
Oracle to Cassandra Core Concepts Guide Pt. 2Oracle to Cassandra Core Concepts Guide Pt. 2
Oracle to Cassandra Core Concepts Guide Pt. 2
DataStax Academy
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 Overview
Eric Nelson
 
What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?ukdpe
 
New fordevelopersinsql server2008
New fordevelopersinsql server2008New fordevelopersinsql server2008
New fordevelopersinsql server2008Aaron Shilo
 
Non-Relational Postgres
Non-Relational PostgresNon-Relational Postgres
Non-Relational Postgres
EDB
 
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...djkucera
 
Meetup cassandra for_java_cql
Meetup cassandra for_java_cqlMeetup cassandra for_java_cql
Meetup cassandra for_java_cql
zznate
 
Chris Mc Glothen Sql Portfolio
Chris Mc Glothen Sql PortfolioChris Mc Glothen Sql Portfolio
Chris Mc Glothen Sql Portfolio
clmcglothen
 
Rdbms (2)
Rdbms (2)Rdbms (2)
Rdbms (2)
Prakash .
 
Database Development Replication Security Maintenance Report
Database Development Replication Security Maintenance ReportDatabase Development Replication Security Maintenance Report
Database Development Replication Security Maintenance Reportnyin27
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency Analysis
University of Illinois,Chicago
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency Analysis
University of Illinois,Chicago
 
Data Exploration with Apache Drill: Day 1
Data Exploration with Apache Drill:  Day 1Data Exploration with Apache Drill:  Day 1
Data Exploration with Apache Drill: Day 1
Charles Givre
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorialAxmed Mo.
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
togather111
 
Most useful queries
Most useful queriesMost useful queries
Most useful queriesSam Depp
 
SQL Windowing
SQL WindowingSQL Windowing
SQL Windowing
Sandun Perera
 
Полнотекстовый поиск в PostgreSQL / Александр Алексеев (Postgres Professional)
Полнотекстовый поиск в PostgreSQL / Александр Алексеев (Postgres Professional)Полнотекстовый поиск в PostgreSQL / Александр Алексеев (Postgres Professional)
Полнотекстовый поиск в PostgreSQL / Александр Алексеев (Postgres Professional)
Ontico
 
Full Text Search in PostgreSQL
Full Text Search in PostgreSQLFull Text Search in PostgreSQL
Full Text Search in PostgreSQL
Aleksander Alekseev
 
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-KompatibilitätMariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB plc
 

Similar to Sqlserver 2008 r2 (20)

Oracle to Cassandra Core Concepts Guide Pt. 2
Oracle to Cassandra Core Concepts Guide Pt. 2Oracle to Cassandra Core Concepts Guide Pt. 2
Oracle to Cassandra Core Concepts Guide Pt. 2
 
SQL Server 2008 Overview
SQL Server 2008 OverviewSQL Server 2008 Overview
SQL Server 2008 Overview
 
What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?What's New for Developers in SQL Server 2008?
What's New for Developers in SQL Server 2008?
 
New fordevelopersinsql server2008
New fordevelopersinsql server2008New fordevelopersinsql server2008
New fordevelopersinsql server2008
 
Non-Relational Postgres
Non-Relational PostgresNon-Relational Postgres
Non-Relational Postgres
 
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
 
Meetup cassandra for_java_cql
Meetup cassandra for_java_cqlMeetup cassandra for_java_cql
Meetup cassandra for_java_cql
 
Chris Mc Glothen Sql Portfolio
Chris Mc Glothen Sql PortfolioChris Mc Glothen Sql Portfolio
Chris Mc Glothen Sql Portfolio
 
Rdbms (2)
Rdbms (2)Rdbms (2)
Rdbms (2)
 
Database Development Replication Security Maintenance Report
Database Development Replication Security Maintenance ReportDatabase Development Replication Security Maintenance Report
Database Development Replication Security Maintenance Report
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency Analysis
 
Pumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency AnalysisPumps, Compressors and Turbine Fault Frequency Analysis
Pumps, Compressors and Turbine Fault Frequency Analysis
 
Data Exploration with Apache Drill: Day 1
Data Exploration with Apache Drill:  Day 1Data Exploration with Apache Drill:  Day 1
Data Exploration with Apache Drill: Day 1
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Sql tutorial
Sql tutorialSql tutorial
Sql tutorial
 
Most useful queries
Most useful queriesMost useful queries
Most useful queries
 
SQL Windowing
SQL WindowingSQL Windowing
SQL Windowing
 
Полнотекстовый поиск в PostgreSQL / Александр Алексеев (Postgres Professional)
Полнотекстовый поиск в PostgreSQL / Александр Алексеев (Postgres Professional)Полнотекстовый поиск в PostgreSQL / Александр Алексеев (Postgres Professional)
Полнотекстовый поиск в PostgreSQL / Александр Алексеев (Postgres Professional)
 
Full Text Search in PostgreSQL
Full Text Search in PostgreSQLFull Text Search in PostgreSQL
Full Text Search in PostgreSQL
 
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-KompatibilitätMariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
 

More from Kashif Akram

Windows azure
Windows azureWindows azure
Windows azure
Kashif Akram
 
Sharepoint as a service platform
Sharepoint as a service platformSharepoint as a service platform
Sharepoint as a service platform
Kashif Akram
 
Sharepoint 2010 composites
Sharepoint 2010   compositesSharepoint 2010   composites
Sharepoint 2010 compositesKashif Akram
 
Microsoft Office Performance Point
Microsoft Office Performance PointMicrosoft Office Performance Point
Microsoft Office Performance Point
Kashif Akram
 
business data catalog - Sharepoint Portal Server 2007
business data catalog - Sharepoint Portal Server 2007business data catalog - Sharepoint Portal Server 2007
business data catalog - Sharepoint Portal Server 2007
Kashif Akram
 
Introduction To Windows Workflow In Windows Share Point
Introduction To Windows Workflow In Windows Share PointIntroduction To Windows Workflow In Windows Share Point
Introduction To Windows Workflow In Windows Share PointKashif Akram
 
Connected Banking Framework
Connected Banking FrameworkConnected Banking Framework
Connected Banking FrameworkKashif Akram
 

More from Kashif Akram (8)

Windows azure
Windows azureWindows azure
Windows azure
 
Sharepoint as a service platform
Sharepoint as a service platformSharepoint as a service platform
Sharepoint as a service platform
 
Sharepoint 2010 composites
Sharepoint 2010   compositesSharepoint 2010   composites
Sharepoint 2010 composites
 
Microsoft Office Performance Point
Microsoft Office Performance PointMicrosoft Office Performance Point
Microsoft Office Performance Point
 
business data catalog - Sharepoint Portal Server 2007
business data catalog - Sharepoint Portal Server 2007business data catalog - Sharepoint Portal Server 2007
business data catalog - Sharepoint Portal Server 2007
 
Introduction To Windows Workflow In Windows Share Point
Introduction To Windows Workflow In Windows Share PointIntroduction To Windows Workflow In Windows Share Point
Introduction To Windows Workflow In Windows Share Point
 
Connected Banking Framework
Connected Banking FrameworkConnected Banking Framework
Connected Banking Framework
 
Vsts
VstsVsts
Vsts
 

Recently uploaded

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 

Recently uploaded (20)

From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 

Sqlserver 2008 r2

  • 1. Sqlserver 2008 R2 Kashif Akram
  • 2. New Datatypes Agenda Datatypes CRL Reporting Services
  • 3. Datetime DATE: As you can imagine, the DATE data type only stores a date in the format of YYYY-MM-DD. It has a range of 0001-01-01 through 9999-12-32, which should be adequate for most business and scientific applications. The accuracy is 1 day, and it only takes 3 bytes to store the date. TIME: TIME is stored in the format: hh:mm:ss.nnnnnnn, with a range of 00:00:00.0000000 through 23:59:59:9999999 and is accurate to 100 nanoseconds. Storage depends on the precision and scale selected, and runs from 3 to 5 bytes.
  • 4. DECLARE @d DATE SET @d = GETDATE() SELECT @d -- outputs '2008-04-06 ' SET @d = '1234-03-22 11:25:09' SELECT @d -- outputs '1234-03-22 '
  • 5. CREATE TABLE #times( T TIME, T1 TIME(1), T5 TIME(5), T7 TIME(7) ) INSERT INTO #times VALUES ( '01:02:03.1234567', '01:02:03.1234567', '01:02:03.1234567', '01:02:03.1234567') SELECT * FROM #times T T1 T5 T7 ---------------- ---------------- ---------------- ---------------- 01:02:03.1234567 01:02:03.1000000 01:02:03.1234600 01:02:03.1234567
  • 6. DATETIME2: DATETIME2 is very similar to the older DATETIME data type, but has a greater range and precision. The format is YYYY-MM-DD hh:mm:ss:nnnnnnnm with a range of 0001-01-01 00:00:00.0000000 through 9999-12-31 23:59:59.9999999, and an accuracy of 100 nanoseconds. Storage depends on the precision and scale selected, and runs from 6 to 8 bytes. DATETIMEOFFSET: DATETIMEOFFSET is similar to DATETIME2, but includes additional information to track the time zone. The format is YYYY-MM-DD hh:mm:ss[.nnnnnnn] [+|-]hh:mm with a range of 0001-01-01 00:00:00.0000000 through 0001-01-01 00:00:00.0000000 through 9999-12-31 23:59:59.9999999 (in UTC), and an accuracy of 100 nanoseconds. Storage depends on the precision and scale selected, and runs from 8 to 10 bytes.
  • 7. DECLARE @dateA DATETIME2 = '2008-04-05 01:02:03.12345' PRINT @dateA -- outputs 2008-04-05 01:02:03.1234500 DECLARE @dateB DATETIME2(4) = '2008-04-05 01:02:03.12345' PRINT @dateB -- outputs 2008-04-05 01:02:03.1235
  • 8. DECLARE @today DATETIMEOFFSET = '2008-04-05T01:02:03.1234567-05:00' PRINT @today -- outputs 2008-04-05 01:02:03.1234567 -05:00 DECLARE @today2 DATETIMEOFFSET(2) = '2008-04-05T01:02:03.1234567-05:00' PRINT @today2 -- outputs 2008-04-05 01:02:03.12 -05:00
  • 9. Spatial GEOMETRY: The GEOMETRY data type is used to store planar (flat-earth) data. It is generally used to store XY coordinates that represent points, lines, and polygons in a two-dimensional space. For example storing XY coordinates in the GEOMETRY data type can be used to map the exterior of a building. GEOGRAPHY: The GEOGRAPHY data type is used to store ellipsoidal (round-earth) data. It is used to store latitude and longitude coordinates that represent points, lines, and polygons on the earth’s surface. For example, GPS data that represents the lay of the land is one example of data that can be stored in theGEOGRAPHY data type.
  • 10. DECLARE @shape geometry SET @shape = geometry::STPolyFromText('POLYGON (( 47.653 -122.358, 47.653 -122.354, 47.657 -122.354, 47.653 -122.350, 47.645 -122.350, ... (snip) 47.651 -122.355, 47.653 -122.358))', 0)
  • 11. SELECT @shape.STEnvelope().ToString() -- outputs something like /* POLYGON (( 47.657 -122.358, 47.657 -122.350, 47.645 -122.350, 47.645 -122.358, 47.657 -122.358)) */
  • 12. HIERARCHYID Organizational structures A set of tasks that make up a larger projects (like a GANTT chart) File systems (folders and their sub-folders) A classification of language terms A bill of materials to assemble or build a product A graphical representation of links between web pages
  • 13. CREATE TABLE #Categories ( CategoryID INT IDENTITY(1,1), CategoryNode HIERARCHYID NOT NULL, CategName NVARCHAR(40) NOT NULL )
  • 14. DECLARE @root HIERARCHYID = hierarchyid::GetRoot() INSERT INTO #Categories (CategoryNode, CategName) VALUES (@root, 'All #Categories') -- insert the 'Electronics' category DECLARE @electronics HIERARCHYID SELECT @electronics = @root.GetDescendant(NULL, NULL) INSERT INTO #Categories (CategoryNode, CategName) VALUES (@electronics, 'Electronics') -- insert the 'Music' category after 'Electronics' DECLARE @music HIERARCHYID SELECT @music = @root.GetDescendant(NULL, @electronics) INSERT INTO #Categories (CategoryNode, CategName) VALUES (@music, 'Music')
  • 15. -- insert the 'Apparel' category between 'Electronics' and 'Music' SELECT @music = @root.GetDescendant(@music, @electronics) INSERT INTO #Categories (CategoryNode, CategName) VALUES (@music, 'Apparel') -- insert some children under 'Electronics' DECLARE @video HIERARCHYID -- We could do a simple @category.GetDescendant() but, let's -- show something that is more likely to happen SELECT @video = CategoryNode.GetDescendant(NULL, NULL) FROM #Categories WHERE CategName ='Electronics' INSERT INTO #Categories (CategoryNode, CategName) VALUES (@video, 'Video Equipment') -- insert some children under 'Video Equipment' DECLARE @tvs HIERARCHYID SELECT @tvs = @video.GetDescendant(NULL, NULL) INSERT INTO #Categories (CategoryNode, CategName) VALUES (@tvs, 'Televisions') DECLARE @players HIERARCHYID SELECT @players = @video.GetDescendant(NULL, @tvs) INSERT INTO #Categories (CategoryNode, CategName) VALUES (@players, 'DVD - BluRay')
  • 16. SELECT CategoryID, CategName, CategoryNode, CategoryNode.ToString() AS Path FROM #Categories
  • 17. FILESTREAM Transact-SQL can be used to SELECT, INSERT, UPDATE, DELETE FILESTREAM data. By default, FILESTREAM data is backed up and restored as part of the database file. If you want, there is an option available so you can backup a database without the FILESTREAM data. The size of the stored data is only limited by the available space of the file system. Standard VARBINARY(MAX) data is limited to 2 GB.
  • 18.
  • 19. USE Production; GO CREATE TABLE DocumentStore ( DocumentID INT IDENTITY PRIMARY KEY, Document VARBINARY (MAX) FILESTREAM NULL, DocGUID UNIQUEIDENTIFIER NOT NULL ROWGUIDCOL UNIQUE DEFAULT NEWID ()) FILESTREAM_ON FileStreamGroup1; GO
  • 20. CLR EXEC sp_configure 'clr enabled', '1' reconfigure