{"id":49118,"date":"2023-01-12T08:00:00","date_gmt":"2023-01-12T16:00:00","guid":{"rendered":""},"modified":"2024-01-31T13:40:39","modified_gmt":"2024-01-31T21:40:39","slug":"working-with-time-series-data-in-sql-server-2022-and-azure-sql","status":"publish","type":"post","link":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/","title":{"rendered":"Working with time series data in SQL Server 2022 and Azure SQL"},"content":{"rendered":"\n<p><em>Part of the&nbsp;<\/em><a href=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/tag\/sql-server-2022-blogging-series\" target=\"_blank\" rel=\"noreferrer noopener\"><em>SQL Server 2022 blog series<\/em><\/a>.<\/p>\n\n\n\n<p>Time series data is a set of values organized in the order in which they occur and arrive for processing. Unlike transactional data in <a href=\"https:\/\/www.microsoft.com\/sql-server\/sql-server-2022\">SQL Server<\/a>, which is not time-based and may be updated often, time series data is typically written once and rarely, if ever, updated.<\/p>\n\n\n\n<p>Some examples of time series data include stock prices, telemetry from equipment sensors on a manufacturing floor, and performance metrics from SQL Server, such as CPU, memory, I\/O, and network utilization.<\/p>\n\n\n\n<p>Time series data is often used for historical comparisons, anomaly detection and alerting, predictive analysis, and reporting, where time is a meaningful axis for viewing or analyzing data.<\/p>\n\n\n\n<p>Time series capabilities in SQL Server were introduced in <a href=\"https:\/\/azure.microsoft.com\/en-ca\/products\/azure-sql\/edge\/\" target=\"_blank\" rel=\"noreferrer noopener\">Azure SQL Edge<\/a>, Microsoft\u2019s version of SQL Server for the Internet of Things (IoT) which combines capabilities such as data streaming and time series with built-in machine learning and graph features.<\/p>\n\n\n<div class=\"wp-block-msxcm-cta-block theme-dark\" data-moray data-bi-an=\"CTA Block\">\n\t<div class=\"card d-block mx-ng mx-md-0\">\n\t\t<div class=\"row no-gutters bg-gray-800 text-white\">\n\n\t\t\t\t\t\t\t<div class=\"col-md-4\">\n\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"682\" src=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2023\/01\/PreviewImage-1024x682.webp\" class=\"card-img img-object-cover\" alt=\"\" srcset=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2023\/01\/PreviewImage-1024x682.webp 1024w, https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2023\/01\/PreviewImage-300x200.webp 300w, https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2023\/01\/PreviewImage-768x511.webp 768w, https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2023\/01\/PreviewImage-800x533.webp 800w, https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2023\/01\/PreviewImage-400x266.webp 400w, https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2023\/01\/PreviewImage.webp 1038w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/>\t\t\t\t<\/div>\n\t\t\t\n\t\t\t<div class=\"d-flex col-md\">\n\t\t\t\t<div class=\"card-body align-self-center p-4 p-md-5\">\n\t\t\t\t\t\n\t\t\t\t\t<h2>SQL Server 2022<\/h2>\n\n\t\t\t\t\t<div class=\"mb-3\">\n\t\t\t\t\t\t<p>The most Azure-enabled release yet, with continued performance, security, and availability innovation.<\/p>\n\t\t\t\t\t<\/div>\n\n\t\t\t\t\t\t\t\t\t\t\t<div class=\"link-group\">\n\t\t\t\t\t\t\t<a href=\"https:\/\/www.microsoft.com\/sql-server\/sql-server-2022\" class=\"btn btn-link text-decoration-none p-0 text-light-blue\" target=\"_blank\">\n\t\t\t\t\t\t\t\t<span>Learn more<\/span>\n\t\t\t\t\t\t\t\t<span class=\"glyph-append glyph-append-chevron-right glyph-append-xsmall\"><\/span>\n\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\n\t\t\t\t\t<\/div>\n\t<\/div>\n<\/div>\n\n\n\n<p>With SQL Server 2022 and Azure SQL, we\u2019ve brought time series capabilities to the entire SQL Server family. Time series capabilities in SQL Server consist of enhancements to existing T-SQL functions for handling <code>NULL<\/code> values, plus two new functions that make working with temporal-based data easier than ever.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"create-contiguous-ranges-with-generate-series\">Create contiguous ranges with GENERATE_SERIES<\/h2>\n\n\n\n<p>When analyzing time series data, it\u2019s common to create a contiguous set of <strong>datetime<\/strong> values in evenly spaced intervals (for example, every second) within a specific range. One way to accomplish this is by creating a numbers table, also known as a tally table, which contains a set of consecutive numbers between a lower and upper bound. The numbers in the table can then be used in combination with the <code><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/functions\/dateadd-transact-sql?view=sql-server-ver16\" target=\"_blank\" rel=\"noreferrer noopener\">DATEADD<\/a><\/code> function to create the range of <strong>datetime <\/strong>values.<\/p>\n\n\n\n<p>Prior to SQL Server 2022, creating a numbers table usually involved some form of common table expressions, <code>CROSS JOIN<\/code> of system objects, looping, or some other creative T-SQL. These solutions are neither elegant nor efficient at scale, with additional complexity when the step between interval values is larger than 1.<\/p>\n\n\n\n<p>The <a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/functions\/generate-series-transact-sql?view=sql-server-ver16\" target=\"_blank\" rel=\"noreferrer noopener\"><code>GENERATE_SERIES<\/code><\/a> relational operator in SQL Server 2022 makes creating a numbers table simple by returning a single-column table of numbers between a <strong>start<\/strong> and <strong>stop <\/strong>value, with an optional parameter defining the number of values to increment\/decrement between steps in the series:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; gutter: false; title: ; quick-code: false; notranslate\" title=\"\">\nGENERATE_SERIES (start, stop [, step ])\n<\/pre><\/div>\n\n\n<p>This example creates a series of numbers between 1 and 100 in steps of 5:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; gutter: false; title: ; quick-code: false; notranslate\" title=\"\">\nSELECT value\nFROM GENERATE_SERIES(1, 100, 5);\n<\/pre><\/div>\n\n\n<p>Taking this concept one step further, the next example shows how GENERATE_SERIES is used with DATEADD to create a set of values between 1:00 PM and 2:00 PM in 1-minute intervals:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; gutter: false; title: ; quick-code: false; notranslate\" title=\"\">\nSELECT DATEADD(minute, s.value, 'Dec 10, 2022 1:00 PM') AS [Interval]\nFROM GENERATE_SERIES(0, 59, 1) AS s;\n<\/pre><\/div>\n\n\n<p>If the step argument is omitted, a default value of 1 is used when computing interval values. GENEATE_SERIES also works with decimal values, with a requirement that the start, stop, and step arguments must all be the same data type. If <strong>start <\/strong>is greater than <strong>stop <\/strong>and the step is a negative value, then the resulting series will be a decrementing set of values. If <strong>start<\/strong> is greater than <strong>stop <\/strong>and the step is positive, an empty table will be returned.<\/p>\n\n\n\n<p>Finally, <code>GENERATE_SERIES<\/code> requires a compatibility level of 160 or higher.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"group-data-in-intervals-with-date-bucket\">Group data in intervals with DATE_BUCKET<\/h2>\n\n\n\n<p>Time series data is often grouped into fixed intervals, or buckets, for analytical purposes. For example, sensor measurements taken every minute may be averaged over 15-minute or 1-hour intervals. While <code>GENERATE_SERIES<\/code> and <code>DATEADD<\/code> are used to create the buckets, we need a way to determine which bucket\/interval a measurement belongs to.<\/p>\n\n\n\n<p>The <code>DATE_BUCKET<\/code> function returns the <strong>datetime <\/strong>value corresponding to the start of each <strong>datetime <\/strong>bucket for an arbitrary bucket size, with an optional parameter to define the origin from which to calculate each bucket. If no origin is provided, the default value of Jan 1, 1900, will be used as the origin date:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; gutter: false; title: ; quick-code: false; notranslate\" title=\"\">\nDATE_BUCKET (datepart, number, date, origin)\n<\/pre><\/div>\n\n\n<p>The following example shows the buckets for Dec 10, 2022, for several date parts with a bucket size of 1 and an origin date of Jan 1, 2022:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; gutter: false; title: ; quick-code: false; notranslate\" title=\"\">\nDECLARE @date DATETIME = 'Dec 10, 2022 12:05 PM';\nDECLARE @origin DATETIME = 'Jan 1, 2022 12:00 AM';\n\nSELECT 'Now' AS [BucketName], @date AS [DateBucketValue]\nUNION ALL\nSELECT 'Year', DATE_BUCKET (YEAR, 1, @date, @origin)\nUNION ALL\nSELECT 'Quarter', DATE_BUCKET (QUARTER, 1, @date, @origin)\nUNION ALL\nSELECT 'Month', DATE_BUCKET (MONTH, 1, @date, @origin)\nUNION ALL\nSELECT 'Week', DATE_BUCKET (WEEK, 1, @date, @origin)\nUNION ALL\nSELECT 'Day', DATE_BUCKET (DAY, 1, @date, @origin)\nUNION ALL\nSELECT 'Hour', DATE_BUCKET (HOUR, 1, @date, @origin)\nUNION ALL\nSELECT 'Minutes', DATE_BUCKET (MINUTE, 1, @date, @origin)\nUNION ALL\nSELECT 'Seconds', DATE_BUCKET (SECOND, 1, @date, @origin)\n<\/pre><\/div>\n\n\n<p>Notice how the date bucket value for the <strong>Week <\/strong>date part is Dec 10, 2022, which is a Saturday. That\u2019s because the provided origin date (Jan 1, 2022) is also a Saturday. (Note the default origin date of Jan 1, 1900, is a Monday). Therefore, when working with the <strong>Week <\/strong>date part, if you want your <strong>Week <\/strong>bucket to begin on a Sunday then be sure to use a known origin that falls on a Sunday.<\/p>\n\n\n\n<p>Where <code>DATE_BUCKET<\/code> becomes especially useful is for bucket sizes larger than 1, for example when grouping data in 5-minute or 15-minute buckets.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; gutter: false; title: ; quick-code: false; notranslate\" title=\"\">\nSELECT 'Now' AS [BucketName], GETDATE() AS [BucketDate]\nUNION ALL\nSELECT '5 Minute Buckets', DATE_BUCKET (MINUTE, 5, GETDATE())\nUNION ALL\nSELECT 'Quarter Hour', DATE_BUCKET (MINUTE, 15, GETDATE());\n<\/pre><\/div>\n\n\n<p><code>DATE_BUCKET<\/code> provides an easy way to determine which time-based interval a timestamped measurement belongs to using any arbitrary-sized interval.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"gap-analysis-with-first-value-and-last-value\">Gap analysis with FIRST_VALUE and LAST_VALUE<\/h2>\n\n\n\n<p><code>FIRST_VALUE<\/code> and <code>LAST_VALUE<\/code> are not new functions to SQL Server 2022; what <em>is <\/em>new is how <code>NULL<\/code> values are handled. In previous versions of SQL Server, <code>NULL<\/code> values are preserved.<\/p>\n\n\n\n<p>When working with time series data, it\u2019s possible to have gaps between measurements. Ideally, gaps are filled in with an imputed value. When using <code>FIRST_VALUE<\/code> and <code>LAST_VALUE<\/code> to compute the value corresponding to an interval, preserving <code>NULL<\/code> values isn\u2019t ideal.<\/p>\n\n\n\n<p>In the following example, a series of sensor readings taken at 15-second intervals has some gaps:<\/p>\n\n\n\n<p>If analyzing the data in 1-minute intervals (using <code>DATE_BUCKET<\/code>), the default value returned by <code>FIRST_VALUE<\/code> will include the null values:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; gutter: false; title: ; quick-code: false; notranslate\" title=\"\">\nSELECT [timestamp]\n   , DATE_BUCKET(MINUTE, 1, [timestamp]) AS [timestamp_bucket]\n   , SensorReading\n   , FIRST_VALUE (SensorReading) OVER ( \nPARTITION BY DATE_BUCKET(MINUTE, 1, [timestamp]) \nORDER BY [timestamp] \nROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING\n) AS [Default (RESPECT NULLS)]\nFROM MachineTelemetry\nORDER BY [timestamp];\n<\/pre><\/div>\n\n\n<p><code>FIRST_VALUE<\/code> and <code>LAST_VALUE<\/code> include new syntax (<code>IGNORE NULLS<\/code> or <code>RESPECT NULLS<\/code>) in SQL Server 2022 which allows you to decide how <code>NULL<\/code> values should be handled:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; gutter: false; title: ; quick-code: false; notranslate\" title=\"\">\nFIRST_VALUE ( [scalar_expression ] )  [ IGNORE NULLS | RESPECT NULLS ]\n    OVER ( [ partition_by_clause ] order_by_clause [ rows_range_clause ] )\n<\/pre><\/div>\n\n\n<p><code>RESPECT NULLS<\/code> is the default behavior and will include null values in the result when computing the first or last value within a partition. Specifying <code>IGNORE NULLS<\/code> will cause <code>NULL<\/code> values to be excluded when computing the first or last value over a partition.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; gutter: false; title: ; quick-code: false; notranslate\" title=\"\">\nSELECT [timestamp]\n   , DATE_BUCKET(MINUTE, 1, [timestamp]) AS [timestamp_bucket]\n   , SensorReading\n   , FIRST_VALUE (SensorReading) IGNORE NULLS OVER ( \nPARTITION BY DATE_BUCKET(MINUTE, 1, [timestamp]) \nORDER BY [timestamp] \nROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING\n) AS [Default (RESPECT NULLS)]\nFROM MachineTelemetry\nORDER BY [timestamp];\n<\/pre><\/div>\n\n\n<p>The new options for <code>IGNORE NULLS<\/code> and <code>RESPECT NULLS<\/code> allow you to decide how null values should be treated when analyzing your data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"learn-more\">Learn more<\/h2>\n\n\n\n<p>Get started with <a href=\"https:\/\/www.microsoft.com\/sql-server\/sql-server-2022\">SQL Server 2022<\/a> today. For more information and additional examples, visit the following resources:<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"microsoft-learn\">Microsoft Learn<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/functions\/generate-series-transact-sql?view=sql-server-ver16\" target=\"_blank\" rel=\"noreferrer noopener\">GENERATE_SERIES<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/functions\/date-bucket-transact-sql?view=sql-server-ver16\" target=\"_blank\" rel=\"noreferrer noopener\">DATE_BUCKET<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/functions\/first-value-transact-sql?view=sql-server-ver16\" target=\"_blank\" rel=\"noreferrer noopener\">FIRST_VALUE<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/t-sql\/functions\/last-value-transact-sql?view=sql-server-ver16\" target=\"_blank\" rel=\"noreferrer noopener\">LAST_VALUE<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"github-examples\">GitHub examples<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/github.com\/microsoft\/bobsql\/tree\/master\/demos\/sqlserver2022\/tsql\/timeseries\" target=\"_blank\" rel=\"noreferrer noopener\">Time Series T-SQL functions in SQL Server 2022<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Time series capabilities in SQL Server were introduced in Azure SQL Edge, Microsoft\u2019s version of SQL Server for the Internet of Things.<\/p>\n","protected":false},"author":6194,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"_classifai_error":"","_classifai_text_to_speech_error":"","footnotes":""},"post_tag":[5278],"product":[5227,3645],"content-type":[2424],"topic":[],"coauthors":[5142],"class_list":["post-49118","post","type-post","status-publish","format-standard","hentry","tag-sql-server-2022-blogging-series","product-sql","product-sql-server-2022","content-type-best-practices","review-flag-1593580427-503","review-flag-1-1593580431-15","review-flag-2-1593580436-981","review-flag-5-1593580452-31","review-flag-inter-1680213150-313","review-flag-iot-1680213325-970","review-flag-machi-1680214154-170","review-flag-micro-1680215164-570","review-flag-new-1593580247-437"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Working with time series data in SQL Server 2022 and Azure SQL - Microsoft SQL Server Blog<\/title>\n<meta name=\"description\" content=\"Time series capabilities in SQL Server were introduced in Azure SQL Edge, Microsoft\u2019s version of SQL Server for the Internet of Things.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Working with time series data in SQL Server 2022 and Azure SQL - Microsoft SQL Server Blog\" \/>\n<meta property=\"og:description\" content=\"Time series capabilities in SQL Server were introduced in Azure SQL Edge, Microsoft\u2019s version of SQL Server for the Internet of Things.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/\" \/>\n<meta property=\"og:site_name\" content=\"Microsoft SQL Server Blog\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/sqlserver\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-12T16:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-31T21:40:39+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/08\/cropped-microsoft_logo_element.png\" \/>\n\t<meta property=\"og:image:width\" content=\"512\" \/>\n\t<meta property=\"og:image:height\" content=\"512\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Kendal Van Dyke\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@SQLServer\" \/>\n<meta name=\"twitter:site\" content=\"@SQLServer\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Kendal Van Dyke\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 min read\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/\"},\"author\":[{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/author\/kenal-van-dyke\/\",\"@type\":\"Person\",\"@name\":\"Kendal Van Dyke\"}],\"headline\":\"Working with time series data in SQL Server 2022 and Azure SQL\",\"datePublished\":\"2023-01-12T16:00:00+00:00\",\"dateModified\":\"2024-01-31T21:40:39+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/\"},\"wordCount\":976,\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization\"},\"keywords\":[\"SQL Server 2022 Blogging Series\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/\",\"name\":\"Working with time series data in SQL Server 2022 and Azure SQL - Microsoft SQL Server Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#website\"},\"datePublished\":\"2023-01-12T16:00:00+00:00\",\"dateModified\":\"2024-01-31T21:40:39+00:00\",\"description\":\"Time series capabilities in SQL Server were introduced in Azure SQL Edge, Microsoft\u2019s version of SQL Server for the Internet of Things.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Working with time series data in SQL Server 2022 and Azure SQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#website\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/\",\"name\":\"Microsoft SQL Server Blog\",\"description\":\"Official News from Microsoft\u2019s Information Platform\",\"publisher\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization\",\"name\":\"Microsoft SQL Server Blog\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png\",\"contentUrl\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png\",\"width\":259,\"height\":194,\"caption\":\"Microsoft SQL Server Blog\"},\"image\":{\"@id\":\"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"http:\/\/www.facebook.com\/sqlserver\",\"https:\/\/x.com\/SQLServer\",\"https:\/\/www.youtube.com\/user\/MSCloudOS\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Working with time series data in SQL Server 2022 and Azure SQL - Microsoft SQL Server Blog","description":"Time series capabilities in SQL Server were introduced in Azure SQL Edge, Microsoft\u2019s version of SQL Server for the Internet of Things.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/","og_locale":"en_US","og_type":"article","og_title":"Working with time series data in SQL Server 2022 and Azure SQL - Microsoft SQL Server Blog","og_description":"Time series capabilities in SQL Server were introduced in Azure SQL Edge, Microsoft\u2019s version of SQL Server for the Internet of Things.","og_url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/","og_site_name":"Microsoft SQL Server Blog","article_publisher":"http:\/\/www.facebook.com\/sqlserver","article_published_time":"2023-01-12T16:00:00+00:00","article_modified_time":"2024-01-31T21:40:39+00:00","og_image":[{"width":512,"height":512,"url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2018\/08\/cropped-microsoft_logo_element.png","type":"image\/png"}],"author":"Kendal Van Dyke","twitter_card":"summary_large_image","twitter_creator":"@SQLServer","twitter_site":"@SQLServer","twitter_misc":{"Written by":"Kendal Van Dyke","Est. reading time":"5 min read"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/#article","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/"},"author":[{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/author\/kenal-van-dyke\/","@type":"Person","@name":"Kendal Van Dyke"}],"headline":"Working with time series data in SQL Server 2022 and Azure SQL","datePublished":"2023-01-12T16:00:00+00:00","dateModified":"2024-01-31T21:40:39+00:00","mainEntityOfPage":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/"},"wordCount":976,"publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization"},"keywords":["SQL Server 2022 Blogging Series"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/","name":"Working with time series data in SQL Server 2022 and Azure SQL - Microsoft SQL Server Blog","isPartOf":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#website"},"datePublished":"2023-01-12T16:00:00+00:00","dateModified":"2024-01-31T21:40:39+00:00","description":"Time series capabilities in SQL Server were introduced in Azure SQL Edge, Microsoft\u2019s version of SQL Server for the Internet of Things.","breadcrumb":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/2023\/01\/12\/working-with-time-series-data-in-sql-server-2022-and-azure-sql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/"},{"@type":"ListItem","position":2,"name":"Working with time series data in SQL Server 2022 and Azure SQL"}]},{"@type":"WebSite","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#website","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/","name":"Microsoft SQL Server Blog","description":"Official News from Microsoft\u2019s Information Platform","publisher":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#organization","name":"Microsoft SQL Server Blog","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png","contentUrl":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-content\/uploads\/2019\/08\/Microsoft-Logo.png","width":259,"height":194,"caption":"Microsoft SQL Server Blog"},"image":{"@id":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/www.facebook.com\/sqlserver","https:\/\/x.com\/SQLServer","https:\/\/www.youtube.com\/user\/MSCloudOS"]}]}},"msxcm_display_generated_audio":false,"msxcm_animated_featured_image":null,"_links":{"self":[{"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/posts\/49118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/users\/6194"}],"replies":[{"embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/comments?post=49118"}],"version-history":[{"count":0,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/posts\/49118\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/media?parent=49118"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/post_tag?post=49118"},{"taxonomy":"product","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/product?post=49118"},{"taxonomy":"content-type","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/content-type?post=49118"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/topic?post=49118"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.microsoft.com\/en-us\/sql-server\/blog\/wp-json\/wp\/v2\/coauthors?post=49118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}