SlideShare une entreprise Scribd logo
1  sur  14
SQL SERVER 2016 TEMPORAL
TABLES
Davide Mauri
www.davidemauri.it | info@davidemauri.it
@mauridb
DAVIDE MAURI
 Microsoft SQL Server Data Platform MVP since 2006
 Works with SQL Server from 6.5, on BI from 2003
 Specialized in DataArchitectures, Database Design, PerformanceTuning, High-
Performance DataWarehousing, BI, Big Data,Azure Data Platform
 President of UGISS (Italian SQL Server UG) for 10 years
 Regular Speaker @ SQL Server events
 E-mail: info@davidemauri.it
 Twitter: @mauridb
 Blog: http://sqlblog.com/blogs/davide_mauri/default.aspx
TEMPORALTABLES
 Automatically keeps track of changed data
 Along with period of validity
 Available in all editions of SQL Server (from the Express!)
 Available in SQL Azure
 ANSI 2011 compliant
 Provide native support for “as-of-time” queries
 Transparent to existing applications (if needed)
 Integrated with existing features (eg: Partitioning, Hekaton)
 Integrated with new features (eg: Stretch Database)
LOVE AT FIRST SIGHT!
 TemporalTables
TEMPORALTABLES
 Automatically keeps track of changed data (versioning)
 Along with period of validity
 Available in all editions of SQL Server (from the Express!)
 Available in SQL Azure
 ANSI 2011 compliant
 Provide native support for temporal queries
 Transparent to existing applications (if needed)
 Integrated with existing features (eg: Partitioning, Hekaton)
 Integrated with new features (eg: Stretch Database)
TEMPORAL QUERIES
 SQL Server 2016 supports
 AS OF <date_time>
 FROM <start_date_time>TO <end_date_time>
 BETWEEN <start_date_time> AND <end_date_time>
 CONTAINED IN (<start_date_time> , <end_date_time>)
 ALL
http://www.ics.uci.edu/~alspaugh/cls/shr/allen.html
TEMPORALTABLES
 Some limitations compared to “classic” tables
 NoTRUNCATETABLE support
 INSTEADOF triggers not supported
 Temporal tables *can* be ALTERed
 A few limitations:
 Cannot add a computed columns
 Cannot add an Identity column
 Versioning can be turned on/off as we wish
 There is *no* automatic cleanup of versioning
 Stretch Database offer “a sort of” automatic archival (but still no cleaning!)
 Tips: https://msdn.microsoft.com/library/mt637341.aspx
DEMO!
Let’s see some live action!
TEMPORALTABLES
 Some limitations compared to “classic” tables
 NoTRUNCATETABLE support
 INSTEADOF triggers not supported
 Temporal tables *can* be ALTERed
 A few limitations:
 Cannot add a computed columns
 Cannot add an Identity column
 Versioning can be turned on/off as we wish
 There is *no* automatic cleanup of versioning
 Stretch Database offer “a sort of” automatic archival (but still no cleaning!)
 Tips: https://msdn.microsoft.com/library/mt637341.aspx
TEMPORALTABLES
 Temporal queries with other operators than “AS OF” can be tricky
 Especially if you’re joining temporal tables
 Rows and not unpacked and then packed back!
 Hugh Darwen http://www.dcs.warwick.ac.uk/~hugh/
DEMO!
Tricky stuff….
ADDITIONAL READS
 First Look at System-VersionedTemporalTables
 http://sqlmag.com/sql-server/first-look-system-versioned-temporal-tables-part-1-
creating-tables-and-modifying-data
 http://sqlmag.com/sql-server/first-look-system-versioned-temporal-tables-part-2-
querying-data-and-optimization-conside
 Temporal data (as a general topic)
 https://www.amazon.com/Time-Relational-Theory-Second-
Management/dp/0128006315
 https://www.pluralsight.com/courses/working-with-temporal-data-sql-server
VOTE ON CONNECT
 Temporal support is good but can be improved! Help telling Microsoft you what
more:
 Add SQL Server Engine Support for Interval Queries (Intersection/Overlap and other
Allen’s interval algebra relations)
 https://connect.microsoft.com/SQLServer/Feedback/Details/780746
 TemporalTables: Connect Item Round Up
 http://sqlblog.com/blogs/adam_machanic/archive/2016/10/04/temporal-tables-connect-item-
round-up.aspx
THANKS!

Contenu connexe

Tendances

Community day 2013 applied architectures
Community day 2013   applied architecturesCommunity day 2013   applied architectures
Community day 2013 applied architectures
Panagiotis Kefalidis
 

Tendances (20)

Iris Multi-Class Classifier with Azure ML
Iris Multi-Class Classifier with Azure MLIris Multi-Class Classifier with Azure ML
Iris Multi-Class Classifier with Azure ML
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep Dive
 
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
1. SQL Server forSharePoint geeksA gentle introductionThomas Vochten • Septem...
 
Optimizing Access with SQL Server
Optimizing Access with SQL ServerOptimizing Access with SQL Server
Optimizing Access with SQL Server
 
Who wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and ResponsibilitiesWho wants to be a DBA? Roles and Responsibilities
Who wants to be a DBA? Roles and Responsibilities
 
Role of-analytics-in-db as-life
Role of-analytics-in-db as-lifeRole of-analytics-in-db as-life
Role of-analytics-in-db as-life
 
No Container: a Modern Java Stack with Bootique
No Container: a Modern Java Stack with BootiqueNo Container: a Modern Java Stack with Bootique
No Container: a Modern Java Stack with Bootique
 
Sql developer - Powerful Free tool for Developers and DBA's
Sql developer - Powerful Free tool for Developers and DBA'sSql developer - Powerful Free tool for Developers and DBA's
Sql developer - Powerful Free tool for Developers and DBA's
 
The databases in SSDT: A work with project and best practices
The databases in SSDT: A work with project and best practicesThe databases in SSDT: A work with project and best practices
The databases in SSDT: A work with project and best practices
 
Debugging made easier with extended events
Debugging made easier with extended eventsDebugging made easier with extended events
Debugging made easier with extended events
 
Understanding indices
Understanding indicesUnderstanding indices
Understanding indices
 
Community day 2013 applied architectures
Community day 2013   applied architecturesCommunity day 2013   applied architectures
Community day 2013 applied architectures
 
Wait Watchers ; Gain SQL Performance Increases Fast!
Wait Watchers; Gain SQL Performance Increases Fast!Wait Watchers; Gain SQL Performance Increases Fast!
Wait Watchers ; Gain SQL Performance Increases Fast!
 
Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...
Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...
Vlad Zelinschi - Embrace Native JavaScript (the anti-plugins talk) - Codecamp...
 
Always On Availability Group Troubleshooting Ninja
Always On Availability Group Troubleshooting Ninja Always On Availability Group Troubleshooting Ninja
Always On Availability Group Troubleshooting Ninja
 
Indexes: The neglected performance all rounder
Indexes: The neglected performance all rounderIndexes: The neglected performance all rounder
Indexes: The neglected performance all rounder
 
Final project
Final projectFinal project
Final project
 
Natural Born Killers, Performance issues to avoid
Natural Born Killers, Performance issues to avoid Natural Born Killers, Performance issues to avoid
Natural Born Killers, Performance issues to avoid
 
WordPress Theme Reviewers Team
WordPress Theme Reviewers TeamWordPress Theme Reviewers Team
WordPress Theme Reviewers Team
 
Ultimate Free SQL Server Toolkit
Ultimate Free SQL Server ToolkitUltimate Free SQL Server Toolkit
Ultimate Free SQL Server Toolkit
 

En vedette

Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data Warehousing
Davide Mauri
 

En vedette (11)

Dashboarding with Microsoft: Datazen & Power BI
Dashboarding with Microsoft: Datazen & Power BIDashboarding with Microsoft: Datazen & Power BI
Dashboarding with Microsoft: Datazen & Power BI
 
Temporal Snapshot Fact Tables
Temporal Snapshot Fact TablesTemporal Snapshot Fact Tables
Temporal Snapshot Fact Tables
 
Azure Stream Analytics
Azure Stream AnalyticsAzure Stream Analytics
Azure Stream Analytics
 
Datarace: IoT e Big Data (Italian)
Datarace: IoT e Big Data (Italian)Datarace: IoT e Big Data (Italian)
Datarace: IoT e Big Data (Italian)
 
Data modeling facts
Data modeling factsData modeling facts
Data modeling facts
 
AzureML - Creating and Using Machine Learning Solutions (Italian)
AzureML - Creating and Using Machine Learning Solutions (Italian)AzureML - Creating and Using Machine Learning Solutions (Italian)
AzureML - Creating and Using Machine Learning Solutions (Italian)
 
Real Time Power BI
Real Time Power BIReal Time Power BI
Real Time Power BI
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data Warehousing
 
Data juice
Data juiceData juice
Data juice
 
Lean Data Warehouse via Data Vault
Lean Data Warehouse via Data VaultLean Data Warehouse via Data Vault
Lean Data Warehouse via Data Vault
 
Azure Machine Learning (Italian)
Azure Machine Learning (Italian)Azure Machine Learning (Italian)
Azure Machine Learning (Italian)
 

Similaire à SQL Server 2016 Temporal Tables

Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
Concentrated Technology
 
World2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverviewWorld2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverview
Farah Omer
 

Similaire à SQL Server 2016 Temporal Tables (20)

SQL Server 2016 new features
SQL Server 2016 new featuresSQL Server 2016 new features
SQL Server 2016 new features
 
Sql 2016 - What's New
Sql 2016 - What's NewSql 2016 - What's New
Sql 2016 - What's New
 
SQL server 2016 New Features
SQL server 2016 New FeaturesSQL server 2016 New Features
SQL server 2016 New Features
 
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
Waiting too long for Excel's VLOOKUP? Use SQLite for simple data analysis!
 
Apoyo en la administración de bases de datos mediante microsoft data tools
Apoyo en la administración de bases de datos mediante microsoft data toolsApoyo en la administración de bases de datos mediante microsoft data tools
Apoyo en la administración de bases de datos mediante microsoft data tools
 
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
 
Introduction to sql database on azure
Introduction to sql database on azureIntroduction to sql database on azure
Introduction to sql database on azure
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
 
Always on in sql server 2017
Always on in sql server 2017Always on in sql server 2017
Always on in sql server 2017
 
Alwayson in sqlserver2017
Alwayson in sqlserver2017Alwayson in sqlserver2017
Alwayson in sqlserver2017
 
Managing SQLserver
Managing SQLserverManaging SQLserver
Managing SQLserver
 
Products.intro.forum version
Products.intro.forum versionProducts.intro.forum version
Products.intro.forum version
 
Sql server 2016 Discovery Day
Sql server 2016 Discovery DaySql server 2016 Discovery Day
Sql server 2016 Discovery Day
 
Access tips access and sql part 1 setting the sql scene
Access tips  access and sql part 1  setting the sql sceneAccess tips  access and sql part 1  setting the sql scene
Access tips access and sql part 1 setting the sql scene
 
Serverless On Stage - Serverless URL Shortener
Serverless On Stage - Serverless URL ShortenerServerless On Stage - Serverless URL Shortener
Serverless On Stage - Serverless URL Shortener
 
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBAKoprowskiT_Session2_SDNEvent_SourceControlForDBA
KoprowskiT_Session2_SDNEvent_SourceControlForDBA
 
Higher Productivity With Ase
Higher Productivity With AseHigher Productivity With Ase
Higher Productivity With Ase
 
World2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverviewWorld2016_T5_S5_SQLServerFunctionalOverview
World2016_T5_S5_SQLServerFunctionalOverview
 
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginnersSQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
SQLSaturday#290_Kiev_AdHocMaintenancePlansForBeginners
 
ECS19 - Thomas Vochten - ESSENTIAL DATABASE ADMINISTRATION SKILLS FOR SHAREPO...
ECS19 - Thomas Vochten - ESSENTIAL DATABASE ADMINISTRATION SKILLS FOR SHAREPO...ECS19 - Thomas Vochten - ESSENTIAL DATABASE ADMINISTRATION SKILLS FOR SHAREPO...
ECS19 - Thomas Vochten - ESSENTIAL DATABASE ADMINISTRATION SKILLS FOR SHAREPO...
 

Plus de Davide Mauri

Plus de Davide Mauri (12)

Azure serverless Full-Stack kickstart
Azure serverless Full-Stack kickstartAzure serverless Full-Stack kickstart
Azure serverless Full-Stack kickstart
 
Agile Data Warehousing
Agile Data WarehousingAgile Data Warehousing
Agile Data Warehousing
 
Dapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDapper: the microORM that will change your life
Dapper: the microORM that will change your life
 
When indexes are not enough
When indexes are not enoughWhen indexes are not enough
When indexes are not enough
 
Building a Real-Time IoT monitoring application with Azure
Building a Real-Time IoT monitoring application with AzureBuilding a Real-Time IoT monitoring application with Azure
Building a Real-Time IoT monitoring application with Azure
 
SSIS Monitoring Deep Dive
SSIS Monitoring Deep DiveSSIS Monitoring Deep Dive
SSIS Monitoring Deep Dive
 
Back to the roots - SQL Server Indexing
Back to the roots - SQL Server IndexingBack to the roots - SQL Server Indexing
Back to the roots - SQL Server Indexing
 
BIML: BI to the next level
BIML: BI to the next levelBIML: BI to the next level
BIML: BI to the next level
 
Data Science Overview
Data Science OverviewData Science Overview
Data Science Overview
 
Delayed durability
Delayed durabilityDelayed durability
Delayed durability
 
Hekaton: In-memory tables
Hekaton: In-memory tablesHekaton: In-memory tables
Hekaton: In-memory tables
 
Hardware planning & sizing for sql server
Hardware planning & sizing for sql serverHardware planning & sizing for sql server
Hardware planning & sizing for sql server
 

Dernier

Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
MarinCaroMartnezBerg
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
amitlee9823
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
AroojKhan71
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Riyadh +966572737505 get cytotec
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
amitlee9823
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
JoseMangaJr1
 

Dernier (20)

Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bellandur ☎ 7737669865 🥵 Book Your One night Stand
 
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and MilvusGenerative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
 
FESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdfFESE Capital Markets Fact Sheet 2024 Q1.pdf
FESE Capital Markets Fact Sheet 2024 Q1.pdf
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
Junnasandra Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore...
 
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night StandCall Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Hsr Layout ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Predicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science ProjectPredicting Loan Approval: A Data Science Project
Predicting Loan Approval: A Data Science Project
 
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al BarshaAl Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
Al Barsha Escorts $#$ O565212860 $#$ Escort Service In Al Barsha
 
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get CytotecAbortion pills in Doha Qatar (+966572737505 ! Get Cytotec
Abortion pills in Doha Qatar (+966572737505 ! Get Cytotec
 
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
Chintamani Call Girls: 🍓 7737669865 🍓 High Profile Model Escorts | Bangalore ...
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.pptSampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
 
BigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptxBigBuy dropshipping via API with DroFx.pptx
BigBuy dropshipping via API with DroFx.pptx
 
Halmar dropshipping via API with DroFx
Halmar  dropshipping  via API with DroFxHalmar  dropshipping  via API with DroFx
Halmar dropshipping via API with DroFx
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 

SQL Server 2016 Temporal Tables

  • 1. SQL SERVER 2016 TEMPORAL TABLES Davide Mauri www.davidemauri.it | info@davidemauri.it @mauridb
  • 2. DAVIDE MAURI  Microsoft SQL Server Data Platform MVP since 2006  Works with SQL Server from 6.5, on BI from 2003  Specialized in DataArchitectures, Database Design, PerformanceTuning, High- Performance DataWarehousing, BI, Big Data,Azure Data Platform  President of UGISS (Italian SQL Server UG) for 10 years  Regular Speaker @ SQL Server events  E-mail: info@davidemauri.it  Twitter: @mauridb  Blog: http://sqlblog.com/blogs/davide_mauri/default.aspx
  • 3. TEMPORALTABLES  Automatically keeps track of changed data  Along with period of validity  Available in all editions of SQL Server (from the Express!)  Available in SQL Azure  ANSI 2011 compliant  Provide native support for “as-of-time” queries  Transparent to existing applications (if needed)  Integrated with existing features (eg: Partitioning, Hekaton)  Integrated with new features (eg: Stretch Database)
  • 4. LOVE AT FIRST SIGHT!  TemporalTables
  • 5. TEMPORALTABLES  Automatically keeps track of changed data (versioning)  Along with period of validity  Available in all editions of SQL Server (from the Express!)  Available in SQL Azure  ANSI 2011 compliant  Provide native support for temporal queries  Transparent to existing applications (if needed)  Integrated with existing features (eg: Partitioning, Hekaton)  Integrated with new features (eg: Stretch Database)
  • 6. TEMPORAL QUERIES  SQL Server 2016 supports  AS OF <date_time>  FROM <start_date_time>TO <end_date_time>  BETWEEN <start_date_time> AND <end_date_time>  CONTAINED IN (<start_date_time> , <end_date_time>)  ALL http://www.ics.uci.edu/~alspaugh/cls/shr/allen.html
  • 7. TEMPORALTABLES  Some limitations compared to “classic” tables  NoTRUNCATETABLE support  INSTEADOF triggers not supported  Temporal tables *can* be ALTERed  A few limitations:  Cannot add a computed columns  Cannot add an Identity column  Versioning can be turned on/off as we wish  There is *no* automatic cleanup of versioning  Stretch Database offer “a sort of” automatic archival (but still no cleaning!)  Tips: https://msdn.microsoft.com/library/mt637341.aspx
  • 8. DEMO! Let’s see some live action!
  • 9. TEMPORALTABLES  Some limitations compared to “classic” tables  NoTRUNCATETABLE support  INSTEADOF triggers not supported  Temporal tables *can* be ALTERed  A few limitations:  Cannot add a computed columns  Cannot add an Identity column  Versioning can be turned on/off as we wish  There is *no* automatic cleanup of versioning  Stretch Database offer “a sort of” automatic archival (but still no cleaning!)  Tips: https://msdn.microsoft.com/library/mt637341.aspx
  • 10. TEMPORALTABLES  Temporal queries with other operators than “AS OF” can be tricky  Especially if you’re joining temporal tables  Rows and not unpacked and then packed back!  Hugh Darwen http://www.dcs.warwick.ac.uk/~hugh/
  • 12. ADDITIONAL READS  First Look at System-VersionedTemporalTables  http://sqlmag.com/sql-server/first-look-system-versioned-temporal-tables-part-1- creating-tables-and-modifying-data  http://sqlmag.com/sql-server/first-look-system-versioned-temporal-tables-part-2- querying-data-and-optimization-conside  Temporal data (as a general topic)  https://www.amazon.com/Time-Relational-Theory-Second- Management/dp/0128006315  https://www.pluralsight.com/courses/working-with-temporal-data-sql-server
  • 13. VOTE ON CONNECT  Temporal support is good but can be improved! Help telling Microsoft you what more:  Add SQL Server Engine Support for Interval Queries (Intersection/Overlap and other Allen’s interval algebra relations)  https://connect.microsoft.com/SQLServer/Feedback/Details/780746  TemporalTables: Connect Item Round Up  http://sqlblog.com/blogs/adam_machanic/archive/2016/10/04/temporal-tables-connect-item- round-up.aspx