Featured resource
2026 Tech Forecast
2026 Tech Forecast

Stay ahead of what’s next in tech with predictions from 1,500+ business leaders, insiders, and Pluralsight Authors.

Get these insights
  • Course

Working With Temporal Data in SQL Server

Working with temporal data in SQL Server is not supported out of the box. Learn how to implement temporal support in a SQL Server database with all of the constraints needed, and how to optimize your temporal queries.

Intermediate
3h 6m
(54)

Created by

Last Updated Nov 01, 2023

Course Thumbnail
  • Course

Working With Temporal Data in SQL Server

Working with temporal data in SQL Server is not supported out of the box. Learn how to implement temporal support in a SQL Server database with all of the constraints needed, and how to optimize your temporal queries.

Intermediate
3h 6m
(54)

Created by

Last Updated Nov 01, 2023

Get started today

Access this course and other top-rated tech content with one of our business plans.

Try this course for free

Access this course and other top-rated tech content with one of our individual plans.

This course is included in the libraries shown below:

  • Data
What you'll learn

Although temporal data is part of many business applications, most RDBMS', including SQL Server, do not support it out of the box. However, before solving the problem, you need to understand it. After an introduction to temporal problems and constraints, you will learn how to implement the solutions. Many solutions are much simpler with the help of a special Interval CLR data type. Additional relational operators PACK and UNPACK are handy as well. Of course, these two operators do not exist in the Transact-SQL language. You will learn how to implement them with help of other language elements. Having a SQL Server solution for a problem does not mean the job is done. Of course, the next immediate issue is performance. Temporal queries that involve intervals are typically very IO and CPU intensive. For example, a test for overlapping intervals was solved with inefficient queries for years. However, a handful of solutions with fast queries was developed recently. This course introduces five different methods to get efficient queries that search for overlapping intervals, one of the most complex temporal problems. Of course, these solutions can be implemented for other temporal problems as well. All the solutions presented should work on any edition of SQL Server from 2008 to 2014.

Working With Temporal Data in SQL Server
Intermediate
3h 6m
(54)
Table of contents

Get started with Pluralsight