SlideShare ist ein Scribd-Unternehmen logo
1 von 18
New features of SQL
2012
Sathyan R
sathyanr@mindfiresolutions.com
ALL SAMPLES FROM ADVENTUREWORKS2012 DB
Agenda
 - Shortcuts
 - New DMVs
 - Spatial Indexes
 - Columstore Indexes
 - String Functions
 - DateTime Functions
 - Conversion Functions
 - Offset and Fetch
 - Sequence
 - With Result Sets
 - Error Handling Enhancements
 - Filetable
 - Analytical Functions
 - Questions posed by Big Data
Shortcuts
 Keyboard Shortcuts
 Query Shortcuts
 Formatting Shortcuts
 Auto Recover (Old)
 Visual Studio Compatible
 Full List
New DMVs
 Server state information that can be used to
monitor the health of a server instance,
diagnose problems, and tune performance.
 Multiple Types (DB, Extended Events,
Execution, Mirroring, CLR, Index, I/O, Security,
Etc.)
 New Additions in 2012
 Select *
Spatial Indexes
 Faster build time for spatial indexes on point
data – critical for tables with millions of rows
 Optimized STDistance and STBuffer Functions
 Row Compression and Page Compression
 sp_help_spatial_geography_histogram
sp_help_spatial_geometry_histogram
 More Details
Columnstore Indexes
 Star Schema - Fact table – Dimension Table
 Row Based Storage
 Columnstore Indexes – Performance
Improvement
 Syntax
 Restrictions – Insert/Update
 Data type restrictions
 Clustered Columnstore Index?
String Functions
 CONCAT
◦Auto Handles NULL
 FORMAT
◦Addresses Issues in DateTime Formatting
◦Culture specific same as in .NET
◦FORMAT ( value, format [, culture ] )
DATETIME Functions
 EOMONTH
 DATEFROMPARTS
◦Sample, Format Date
 DATETIME2FROMPARTS
 TIMEFROMPARTS
 DATETIMEFROMPARTS
 DATETIMEOFFSETFROMPARTS
Conversion Functions
 TRY_PARSE
 PARSE
 TRY_CONVERT
Logical Functions
 IIF
 CHOOSE
Offset and Fetch
 Are You Paginating Right?
SEQUENCE
 Identity
 SEQUENCE - at DB level - used across
multiple tables – Controlled by App
 SEQUENCE can be reset without altering
its previous value – MIN – MAX - CYCLE
SEQUENCE USAGE - MSDN
 The application requires a number before the insert into the table is made.
 The application requires sharing a single series of numbers between multiple
tables or multiple columns within a table.
 The application must restart the number series when a specified number is
reached. For example, after assigning values 1 through 10, the application starts
assigning values 1 through 10 again.
 The application requires sequence values to be sorted by another field. The NEXT
VALUE FOR function can apply the OVER clause to the function call. The OVER
clause guarantees that the values returned are generated in the order of the
OVER clause's ORDER BY clause.
 An application requires multiple numbers to be assigned at the same time. For
example, an application needs to reserve five sequential numbers. Requesting
identity values could result in gaps in the series if other processes were
simultaneously issued numbers. Calling sp_sequence_get_range can retrieve
several numbers in the sequence at once.
 You need to change the specification of the sequence, such as the increment
value.
WITH RESULT SETS
 change the column names and data types
of the result set returned in the execution
of a SP
Error Handling With Throw
 Much Easier, Simpler
 Similar to .NET
 No need of @@RAISE_ERROR Anymore
Filetable
 Filetable in SQL 2012
 http://www.ourgoalplan.com/KLMS/TipVie
w.aspx?id=3241
Analytical Functions
 FIRST_VALUE
 LAST_VALUE
 LAG
 LEAD
Questions Posed by BigData
 Velocity Volume Variability
 Hadoop - DFS
 Facebook Twitter Google
 Two different reasons
 SSD – Solid State Data Storage allows
100,000s IOPS Vs 150 to 200
 Hortonworks and Cloudera

Weitere ähnliche Inhalte

Was ist angesagt?

Using single row functions to customize output
Using single row functions to customize outputUsing single row functions to customize output
Using single row functions to customize output
Syed Zaid Irshad
 
Environmental Services Call Log - Access 2007
Environmental Services Call Log - Access 2007Environmental Services Call Log - Access 2007
Environmental Services Call Log - Access 2007
Kerry Mahoney-Parrish
 

Was ist angesagt? (20)

SQL Data Manipulation
SQL Data ManipulationSQL Data Manipulation
SQL Data Manipulation
 
Using single row functions to customize output
Using single row functions to customize outputUsing single row functions to customize output
Using single row functions to customize output
 
Aggregating Data Using Group Functions
Aggregating Data Using Group FunctionsAggregating Data Using Group Functions
Aggregating Data Using Group Functions
 
Utility Procedures in SAS
Utility Procedures in SASUtility Procedures in SAS
Utility Procedures in SAS
 
Sql oracle
Sql oracleSql oracle
Sql oracle
 
Displaying Data from Multiple Tables - Oracle Data Base
Displaying Data from Multiple Tables - Oracle Data BaseDisplaying Data from Multiple Tables - Oracle Data Base
Displaying Data from Multiple Tables - Oracle Data Base
 
Sql server ___________session 3(sql 2008)
Sql server  ___________session 3(sql 2008)Sql server  ___________session 3(sql 2008)
Sql server ___________session 3(sql 2008)
 
Excel 2007 Unit E
Excel 2007 Unit EExcel 2007 Unit E
Excel 2007 Unit E
 
SAS Macros
SAS MacrosSAS Macros
SAS Macros
 
Environmental Services Call Log - Access 2007
Environmental Services Call Log - Access 2007Environmental Services Call Log - Access 2007
Environmental Services Call Log - Access 2007
 
Excel 2007 Unit K
Excel 2007 Unit KExcel 2007 Unit K
Excel 2007 Unit K
 
1. dml select statement reterive data
1. dml select statement reterive data1. dml select statement reterive data
1. dml select statement reterive data
 
Excel 2007 Unit B
Excel 2007 Unit BExcel 2007 Unit B
Excel 2007 Unit B
 
Data annotation validation (ASP.net)
Data annotation validation (ASP.net)Data annotation validation (ASP.net)
Data annotation validation (ASP.net)
 
Excel 2007 Unit L
Excel 2007 Unit LExcel 2007 Unit L
Excel 2007 Unit L
 
Where conditions and Operators in SQL
Where conditions and Operators in SQLWhere conditions and Operators in SQL
Where conditions and Operators in SQL
 
Sql server select queries ppt 18
Sql server select queries ppt 18Sql server select queries ppt 18
Sql server select queries ppt 18
 
SAS Proc SQL
SAS Proc SQLSAS Proc SQL
SAS Proc SQL
 
Reading Fixed And Varying Data
Reading Fixed And Varying DataReading Fixed And Varying Data
Reading Fixed And Varying Data
 
Calnf
CalnfCalnf
Calnf
 

Andere mochten auch

Language enhancements in cold fusion 11
Language enhancements in cold fusion 11Language enhancements in cold fusion 11
Language enhancements in cold fusion 11
ColdFusionConference
 

Andere mochten auch (9)

Hidden Gems in ColdFusion 11
Hidden Gems in ColdFusion 11Hidden Gems in ColdFusion 11
Hidden Gems in ColdFusion 11
 
CFML Enhancements in ColdFusion 10
CFML Enhancements in ColdFusion 10 CFML Enhancements in ColdFusion 10
CFML Enhancements in ColdFusion 10
 
Language enhancements in cold fusion 11
Language enhancements in cold fusion 11Language enhancements in cold fusion 11
Language enhancements in cold fusion 11
 
ColdFusion 11 Overview - CFSummit 2013
ColdFusion 11 Overview - CFSummit 2013ColdFusion 11 Overview - CFSummit 2013
ColdFusion 11 Overview - CFSummit 2013
 
Mobile Apps using Flex and ColdFusion
Mobile Apps using Flex and ColdFusionMobile Apps using Flex and ColdFusion
Mobile Apps using Flex and ColdFusion
 
Hidden Gems in ColdFusion 2016
Hidden Gems in ColdFusion 2016Hidden Gems in ColdFusion 2016
Hidden Gems in ColdFusion 2016
 
ColdFusion 10 CFScript Enhancements
ColdFusion 10 CFScript EnhancementsColdFusion 10 CFScript Enhancements
ColdFusion 10 CFScript Enhancements
 
ColdFusion 11 New Features
ColdFusion 11 New FeaturesColdFusion 11 New Features
ColdFusion 11 New Features
 
ColdFusion 10
ColdFusion 10ColdFusion 10
ColdFusion 10
 

Ähnlich wie New features of SQL 2012

Base sas interview questions
Base sas interview questionsBase sas interview questions
Base sas interview questions
Dr P Deepak
 
Using New Data Types In2008
Using New Data Types In2008Using New Data Types In2008
Using New Data Types In2008
PhilWinstanley
 
Understand when to use user defined functions in sql server tech-republic
Understand when to use user defined functions in sql server   tech-republicUnderstand when to use user defined functions in sql server   tech-republic
Understand when to use user defined functions in sql server tech-republic
Kaing Menglieng
 

Ähnlich wie New features of SQL 2012 (20)

Merging data (1)
Merging data (1)Merging data (1)
Merging data (1)
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
 
Base sas interview questions
Base sas interview questionsBase sas interview questions
Base sas interview questions
 
Base sas interview questions
Base sas interview questionsBase sas interview questions
Base sas interview questions
 
SQL Database Performance Tuning for Developers
SQL Database Performance Tuning for DevelopersSQL Database Performance Tuning for Developers
SQL Database Performance Tuning for Developers
 
CIS 282 Final Review
CIS 282 Final ReviewCIS 282 Final Review
CIS 282 Final Review
 
Migrate Microsoft Access to SQL Server
Migrate Microsoft Access to SQL ServerMigrate Microsoft Access to SQL Server
Migrate Microsoft Access to SQL Server
 
Using New Data Types In2008
Using New Data Types In2008Using New Data Types In2008
Using New Data Types In2008
 
Analysing Performance of Algorithmic SQL and PLSQL.pptx
Analysing Performance of Algorithmic SQL and PLSQL.pptxAnalysing Performance of Algorithmic SQL and PLSQL.pptx
Analysing Performance of Algorithmic SQL and PLSQL.pptx
 
Novidades do SQL Server 2016
Novidades do SQL Server 2016Novidades do SQL Server 2016
Novidades do SQL Server 2016
 
Tech Days09 Sqldev
Tech Days09 SqldevTech Days09 Sqldev
Tech Days09 Sqldev
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
 
SQL Server 2008 for .NET Developers
SQL Server 2008 for .NET DevelopersSQL Server 2008 for .NET Developers
SQL Server 2008 for .NET Developers
 
Sql DML
Sql DMLSql DML
Sql DML
 
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
SQL – The Natural Language for Analysis - Oracle - Whitepaper - 2431343
 
Understand when to use user defined functions in sql server tech-republic
Understand when to use user defined functions in sql server   tech-republicUnderstand when to use user defined functions in sql server   tech-republic
Understand when to use user defined functions in sql server tech-republic
 
Oracle_Analytical_function.pdf
Oracle_Analytical_function.pdfOracle_Analytical_function.pdf
Oracle_Analytical_function.pdf
 
Introduction to SQL, SQL*Plus
Introduction to SQL, SQL*PlusIntroduction to SQL, SQL*Plus
Introduction to SQL, SQL*Plus
 
Fg d
Fg dFg d
Fg d
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
 

Mehr von Mindfire Solutions

Mehr von Mindfire Solutions (20)

Physician Search and Review
Physician Search and ReviewPhysician Search and Review
Physician Search and Review
 
diet management app
diet management appdiet management app
diet management app
 
Business Technology Solution
Business Technology SolutionBusiness Technology Solution
Business Technology Solution
 
Remote Health Monitoring
Remote Health MonitoringRemote Health Monitoring
Remote Health Monitoring
 
Influencer Marketing Solution
Influencer Marketing SolutionInfluencer Marketing Solution
Influencer Marketing Solution
 
ELMAH
ELMAHELMAH
ELMAH
 
High Availability of Azure Applications
High Availability of Azure ApplicationsHigh Availability of Azure Applications
High Availability of Azure Applications
 
IOT Hands On
IOT Hands OnIOT Hands On
IOT Hands On
 
Glimpse of Loops Vs Set
Glimpse of Loops Vs SetGlimpse of Loops Vs Set
Glimpse of Loops Vs Set
 
Oracle Sql Developer-Getting Started
Oracle Sql Developer-Getting StartedOracle Sql Developer-Getting Started
Oracle Sql Developer-Getting Started
 
Adaptive Layout In iOS 8
Adaptive Layout In iOS 8Adaptive Layout In iOS 8
Adaptive Layout In iOS 8
 
Introduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/MacIntroduction to Auto-layout : iOS/Mac
Introduction to Auto-layout : iOS/Mac
 
LINQPad - utility Tool
LINQPad - utility ToolLINQPad - utility Tool
LINQPad - utility Tool
 
Get started with watch kit development
Get started with watch kit developmentGet started with watch kit development
Get started with watch kit development
 
Swift vs Objective-C
Swift vs Objective-CSwift vs Objective-C
Swift vs Objective-C
 
Material Design in Android
Material Design in AndroidMaterial Design in Android
Material Design in Android
 
Introduction to OData
Introduction to ODataIntroduction to OData
Introduction to OData
 
Ext js Part 2- MVC
Ext js Part 2- MVCExt js Part 2- MVC
Ext js Part 2- MVC
 
ExtJs Basic Part-1
ExtJs Basic Part-1ExtJs Basic Part-1
ExtJs Basic Part-1
 
Spring Security Introduction
Spring Security IntroductionSpring Security Introduction
Spring Security Introduction
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

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...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 

New features of SQL 2012

  • 1. New features of SQL 2012 Sathyan R sathyanr@mindfiresolutions.com ALL SAMPLES FROM ADVENTUREWORKS2012 DB
  • 2. Agenda  - Shortcuts  - New DMVs  - Spatial Indexes  - Columstore Indexes  - String Functions  - DateTime Functions  - Conversion Functions  - Offset and Fetch  - Sequence  - With Result Sets  - Error Handling Enhancements  - Filetable  - Analytical Functions  - Questions posed by Big Data
  • 3. Shortcuts  Keyboard Shortcuts  Query Shortcuts  Formatting Shortcuts  Auto Recover (Old)  Visual Studio Compatible  Full List
  • 4. New DMVs  Server state information that can be used to monitor the health of a server instance, diagnose problems, and tune performance.  Multiple Types (DB, Extended Events, Execution, Mirroring, CLR, Index, I/O, Security, Etc.)  New Additions in 2012  Select *
  • 5. Spatial Indexes  Faster build time for spatial indexes on point data – critical for tables with millions of rows  Optimized STDistance and STBuffer Functions  Row Compression and Page Compression  sp_help_spatial_geography_histogram sp_help_spatial_geometry_histogram  More Details
  • 6. Columnstore Indexes  Star Schema - Fact table – Dimension Table  Row Based Storage  Columnstore Indexes – Performance Improvement  Syntax  Restrictions – Insert/Update  Data type restrictions  Clustered Columnstore Index?
  • 7. String Functions  CONCAT ◦Auto Handles NULL  FORMAT ◦Addresses Issues in DateTime Formatting ◦Culture specific same as in .NET ◦FORMAT ( value, format [, culture ] )
  • 8. DATETIME Functions  EOMONTH  DATEFROMPARTS ◦Sample, Format Date  DATETIME2FROMPARTS  TIMEFROMPARTS  DATETIMEFROMPARTS  DATETIMEOFFSETFROMPARTS
  • 11. Offset and Fetch  Are You Paginating Right?
  • 12. SEQUENCE  Identity  SEQUENCE - at DB level - used across multiple tables – Controlled by App  SEQUENCE can be reset without altering its previous value – MIN – MAX - CYCLE
  • 13. SEQUENCE USAGE - MSDN  The application requires a number before the insert into the table is made.  The application requires sharing a single series of numbers between multiple tables or multiple columns within a table.  The application must restart the number series when a specified number is reached. For example, after assigning values 1 through 10, the application starts assigning values 1 through 10 again.  The application requires sequence values to be sorted by another field. The NEXT VALUE FOR function can apply the OVER clause to the function call. The OVER clause guarantees that the values returned are generated in the order of the OVER clause's ORDER BY clause.  An application requires multiple numbers to be assigned at the same time. For example, an application needs to reserve five sequential numbers. Requesting identity values could result in gaps in the series if other processes were simultaneously issued numbers. Calling sp_sequence_get_range can retrieve several numbers in the sequence at once.  You need to change the specification of the sequence, such as the increment value.
  • 14. WITH RESULT SETS  change the column names and data types of the result set returned in the execution of a SP
  • 15. Error Handling With Throw  Much Easier, Simpler  Similar to .NET  No need of @@RAISE_ERROR Anymore
  • 16. Filetable  Filetable in SQL 2012  http://www.ourgoalplan.com/KLMS/TipVie w.aspx?id=3241
  • 17. Analytical Functions  FIRST_VALUE  LAST_VALUE  LAG  LEAD
  • 18. Questions Posed by BigData  Velocity Volume Variability  Hadoop - DFS  Facebook Twitter Google  Two different reasons  SSD – Solid State Data Storage allows 100,000s IOPS Vs 150 to 200  Hortonworks and Cloudera