{"id":14085,"date":"2019-12-03T07:20:13","date_gmt":"2019-12-03T07:20:13","guid":{"rendered":"https:\/\/dbtut.com\/?p=14085"},"modified":"2019-12-03T07:20:46","modified_gmt":"2019-12-03T07:20:46","slug":"temporal-tables-in-sql-server","status":"publish","type":"post","link":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/","title":{"rendered":"Temporal Tables in SQL Server"},"content":{"rendered":"<h2>What is a temporal table in SQL Server?<\/h2>\n<p>We can store the history of inserts, updates and deletes by using temporal tables. Previously, we could only store the latest version of the data. And if someone perform an incorrect update, we could have solved the problem by using the backup. Other benefits of temporal tables are listed below.<\/p>\n<p>Temporal table allows us to analyze data at a certain time in the past thanks to we store a history of data.<\/p>\n<p>All temporal tables have two columns, datetime2 type, Period start column and Period end column. These columns are called period columns. These period columns are used to store how long this change takes effect when a row changes. I think it would be more clearly understood with an example.<\/p>\n<p><strong>Period start column<\/strong> stores the moment the transaction starts. For example, you started a transaction and performed multiple transactions in that transaction. The value in the period start column is the start time of the transaction for all transactions, regardless of the end time of the transaction.<\/p>\n<p>Temporal tables also maintain the same table&#8217;s schema structure in another table (history table). When there is an update or delete operation in the temporal table, the version before this change is stored in the history table.<\/p>\n<p>When creating the temporal table, you can create another table with the same schema structure as the temporal table and specify it as history table. If you do not specify, the history table will be created automatically by the sql server. History tables have period columns as in temporal tables.<\/p>\n<h2>Benefits of Temporal Tables<\/h2>\n<p>\u2022 You can audit the operations performed by the application developers. Thus, transactions are recorded.<br \/>\n\u2022 You can reconfigure a version of the data at a time in the past.<br \/>\n\u2022 You can see the change curve of data for KDS applications.<br \/>\n\u2022 If an incorrect action has been taken, you can undo it. As database administrators, I would say that there is a solution that saves us from a huge workload.<\/p>\n<h2>Create a Temporal Table<\/h2>\n<p>Let&#8217;s create a temporal table as follows. As you can see in the script, the table name is TemporalExample. The name of the History table is TemporalExample_HistoryTable.<\/p>\n<pre class=\"lang:default decode:true\">CREATE TABLE dbo.TemporalExample\n(   [ID] int NOT NULL PRIMARY KEY CLUSTERED\n  , [Name] VARCHAR(100) NOT NULL   \n  , [Surname] VARCHAR(100) NOT NULL  \n  , [Salary] INT NOT NULL  \n  , [PeriodStart] datetime2 (2) GENERATED ALWAYS AS ROW START  \n  , [PeriodEnd] datetime2 (2) GENERATED ALWAYS AS ROW END  \n  , PERIOD FOR SYSTEM_TIME (PeriodStart, PeriodEnd)  \n )    \n WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE = dbo.TemporalExample_HistoryTable)); \n<\/pre>\n<p>After creating the table, insert some records.<\/p>\n<pre class=\"lang:default decode:true\">INSERT INTO [dbo].[TemporalExample]([ID],[Name],[Surname],[Salary]) \nVALUES (1,'Nurullah','CAKIR',1000),\n\t   (2,'Hakan','GURBASLAR',1000),\n\t   (3,'Faruk','ERDEM',1000),\n\t   (4,'Dilara','AYDIN',1000)\n<\/pre>\n<p>Then, to see what&#8217;s happening, let&#8217;s query the TemporalExample table and the TemporalSample_HistoryTable table as follows.<\/p>\n<pre class=\"lang:default decode:true\">SELECT *  FROM [test].[dbo].[TemporalExample]\nGO\nSELECT *  FROM [test].[dbo].[TemporalExample_HistoryTable]<\/pre>\n<p>As you can see below, the PeriodStart and PeriodEnd columns are set automatically.<\/p>\n<p>The PeriodStart column shows the start time of the transaction,<\/p>\n<p>&#8216;9999-12-31 23: 59: 59: 59&#8217; was set in the PeriodEnd column.<\/p>\n<p>We said that the previous version of the changes was stored in the History table. So we see that the history table is still empty.<\/p>\n<p id=\"YWOXjht\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14099 aligncenter\" src=\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-92.png\" alt=\"\" width=\"631\" height=\"347\" \/><\/p>\n<p>Now let&#8217;s perform an update to see how the data is stored in the history table.<\/p>\n<p>As you can see in Script I&#8217;m raising my own salary 1 dollar. \ud83d\ude42<\/p>\n<pre class=\"lang:default decode:true\">UPDATE [dbo].[TemporalExample] SET [Salary] = 1001 WHERE Name='Nurullah'<\/pre>\n<p>I&#8217;m running the same select statements again after I run the Update query.<\/p>\n<p>As you can see below, the line of Nurullah has a Salary of 1001 and the PeriodStart column has changed.<\/p>\n<p>We also see a new record in the History table. In this table we see the old Salary value.<\/p>\n<p>In the PeriodStart column we see the time when this value of this row is set.<\/p>\n<p>In the PeriodEnd column, we see when this value is updated.<\/p>\n<p id=\"QXjUEGb\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14100 aligncenter\" src=\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-93.png\" alt=\"\" width=\"559\" height=\"439\" \/><\/p>\n<p>Let&#8217;s delete the same line this time and run the select statements again.<\/p>\n<pre class=\"lang:default decode:true\">DELETE [dbo].[TemporalExample] WHERE Name='Nurullah'<\/pre>\n<p>As you can see, a row is added to the history table each time data is changed.<\/p>\n<p>The final version of our tables is as follows:<\/p>\n<p id=\"cvRfMOM\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14101 aligncenter\" src=\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-94.png\" alt=\"\" width=\"567\" height=\"435\" \/><\/p>\n<p>With the help of the following query, you can query the records in a specific date range with the version information by using both tables.<\/p>\n<p><strong>Note:<\/strong> Change the time according to current date.<\/p>\n<pre class=\"lang:default decode:true\">SELECT * FROM [test].[dbo].[TemporalExample]   \nFOR SYSTEM_TIME    \nBETWEEN '2019-11-28 13:46:00.00' AND '2019-11-28 13:56:00.00'   \nWHERE Name= 'Nurullah' ORDER BY PeriodStart;  \n<\/pre>\n<p id=\"ZrpsqGc\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-14102 aligncenter\" src=\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-95.png\" alt=\"\" width=\"598\" height=\"203\" \/><\/p>\n<p>With the help of the following query, you can query all records with version information by using both tables.<\/p>\n<pre class=\"lang:default decode:true \">SELECT * FROM [test].[dbo].[TemporalExample]   \nFOR SYSTEM_TIME  ALL\nORDER BY PeriodStart;<\/pre>\n<p>If you run the DROP TABLE script to delete temporal tables, you will receive an error like the one below.<\/p>\n<p><span style=\"color: #ff0000;\"><em>Msg 13552, Level 16, State 1, Line 12<\/em><\/span><\/p>\n<p><span style=\"color: #ff0000;\"><em>Drop table operation failed on table &#8216;test.dbo.TemporalExample&#8217; because it is not supported operation on system-versioned temporal tables.<\/em><\/span><\/p>\n<p>In order to perform the deletion, you must first turn off the versioning in the table. You can delete your temporal tables by turning off versioning with the following script.<\/p>\n<pre class=\"lang:default decode:true\">ALTER TABLE [dbo].[TemporalExample_HistoryTable] SET ( SYSTEM_VERSIONING = OFF )\nGO\nDROP TABLE [dbo].[TemporalExample]\nGO\nDROP TABLE [dbo].[TemporalExample_HistoryTable]<\/pre>\n<p>By default, there is a clustered index on the periodstart and periodend columns in the history table. For better performance, I recommend creating a history table manually and creating a clustered columnstore index on these two columns.<\/p>\n<p>Although it sounds like a nice feature at first. But there are some limits and restrictions. Below you can find its limits and restrictions.<\/p>\n<h2>Temporal Table Limitations and Restrictions<\/h2>\n<p>\u2022 There must be Primary in the main table.<br \/>\n\u2022 If the main table is partitioned, the history table is created in the default file group.<br \/>\n\u2022 The main and history tables can not be file tables.<br \/>\n\u2022 Although the main table supports data types such as (n) varchar (max), varbinary (max), (n) text, and image, there is a significant storage cost when you create the temporal table with these data types. There may also be a performance problem due to the size of these data types.<br \/>\n\u2022 The History table cannot contain primary key, foreign key, table, or column constraint.<br \/>\n\u2022 No indexed view support.<br \/>\n\u2022 TRUNCATE and DROP TABLE are not supported when system versioning is on.<br \/>\n\u2022 The main table does not support ON DELETE CASCADE and ON UPDATE CASCADE. You can find out what these statements mean in the article &#8220;What is ON DELETE CASCADE and ON UPDATE CASCADE&#8221;. This is supported in SQL Server 2017 CTP 2.0.<br \/>\n\u2022 INSTEAD OF trigger is not supported. AFTER Trigger is only supported for Main table. You can find detailed information about trigger types in the article &#8220;SQL Server Trigger Types&#8221;.<br \/>\n\u2022 Supports Change Data Capture and Change Tracking only for the main table. You may want to read the article &#8220;Change Data Capture (CDC)&#8221;.<br \/>\n\u2022 No merge replication support.<\/p>\n<h2>Create a Memory Optimized Temporal Tables<\/h2>\n<pre class=\"lang:default decode:true\">CREATE TABLE dbo.TemporalExampleInMemory   \n(   [ID] int NOT NULL PRIMARY KEY NONCLUSTERED\n  , [Name] VARCHAR(100) NOT NULL   \n  , [Surname] VARCHAR(100) NOT NULL  \n  , [Salary] INT NOT NULL  \n  , [PeriodStart] datetime2 GENERATED ALWAYS AS ROW START HIDDEN NOT NULL\n  , [PeriodEnd] datetime2 GENERATED ALWAYS AS ROW END HIDDEN NOT NULL    \n  , PERIOD FOR SYSTEM_TIME (PeriodStart, PeriodEnd)  \n )    \n WITH   \n    (  \n        MEMORY_OPTIMIZED = ON, DURABILITY = SCHEMA_AND_DATA,  \n            SYSTEM_VERSIONING = ON ( HISTORY_TABLE = dbo.TemporalExampleInMemory_HistoryTable )   \n    );  \n<\/pre>\n\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_14085\" class=\"pvc_stats all  \" data-element-id=\"14085\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/dbtut.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>What is a temporal table in SQL Server? We can store the history of inserts, updates and deletes by using temporal tables. Previously, we could only store the latest version of the data. And if someone perform an incorrect update, we could have solved the problem by using the backup. Other benefits of temporal tables &hellip;<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_14085\" class=\"pvc_stats all  \" data-element-id=\"14085\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/dbtut.com\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":14105,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3],"tags":[6461,6460,6483,6495,6496,6482,6478,6485,6486,6490,6480,6479,6471,6466,6473,6488,6477,6494,6489,6462,6481,6472,6491,6493,6492,6487,6476,6474,6469,6475,6468,6467,6463,6465,6470,6484,6464],"class_list":["post-14085","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-mssql","tag-advantages-of-temporal-tables","tag-benefits-of-temporal-tables","tag-create-a-memory-optimized-temporal-table","tag-create-a-memory-optimized-temporal-tables","tag-create-a-temporal-table","tag-create-memory-optimized-temporal-tables","tag-create-temporal-tables","tag-creating-a-memory-optimized-system-versioned-temporal-table","tag-creating-a-memory-optimized-system-versioned-temporal-tables","tag-creating-a-memory-optimized-temporal-table","tag-drop-table-operation-failed-on-table-x-because-it-is-not-supported-operation-on-system-versioned-temporal-tables","tag-drop-table-operation-failed-on-table-because-it-is-not-supported-operation-on-system-versioned-temporal-tables","tag-how-do-i-find-the-history-of-a-sql-server-database","tag-how-do-temporal-tables-work","tag-introduction-to-sql-server-temporal-tables","tag-memory-optimized-temporal-tables-in-sql-server","tag-temporal-table-in-sql-server","tag-temporal-table-limitations-and-restrictions","tag-temporal-table-with-in-memory","tag-temporal-tables","tag-temporal-tables-in-memory","tag-temporal-tables-in-sql-server","tag-temporal-tables-limitations","tag-temporal-tables-limitations-and-restrictions","tag-temporal-tables-restrictions","tag-temporal-tables-with-memory-optimized-tables","tag-what-are-temporal-tables","tag-what-are-temporal-tables-in-sql-server","tag-what-are-temporal-tables-in-sql-server-2016","tag-what-are-temporal-tables-sql","tag-what-are-the-uses-of-temporal-tables-choose-all-that-apply","tag-what-are-the-uses-of-temporal-tables","tag-what-is-a-temporal-table","tag-what-is-a-temporal-table-in-sql-server","tag-what-is-history-table-in-sql-server","tag-what-is-temporal-table","tag-what-is-temporal-tables"],"aioseo_notices":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Temporal Tables in SQL Server - Database Tutorials<\/title>\n<meta name=\"description\" content=\"Temporal Tables in SQL Server\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Temporal Tables in SQL Server - Database Tutorials\" \/>\n<meta property=\"og:description\" content=\"Temporal Tables in SQL Server\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"Database Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-03T07:20:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-12-03T07:20:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-96.png\" \/>\n\t<meta property=\"og:image:width\" content=\"496\" \/>\n\t<meta property=\"og:image:height\" content=\"287\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"dbtut\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"dbtut\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/\"},\"author\":{\"name\":\"dbtut\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408\"},\"headline\":\"Temporal Tables in SQL Server\",\"datePublished\":\"2019-12-03T07:20:13+00:00\",\"dateModified\":\"2019-12-03T07:20:46+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/\"},\"wordCount\":1007,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/dbtut.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-96.png\",\"keywords\":[\"advantages of Temporal Tables\",\"Benefits of Temporal Tables\",\"Create a memory optimized Temporal Table\",\"Create a Memory Optimized Temporal Tables\",\"Create a Temporal Table\",\"Create Memory Optimized Temporal Tables\",\"create temporal tables\",\"Creating a Memory-Optimized System-Versioned Temporal table\",\"Creating a Memory-Optimized System-Versioned Temporal tables\",\"Creating a Memory-Optimized Temporal Table\",\"Drop table operation failed on table 'x' because it is not supported operation on system-versioned temporal tables.\",\"Drop table operation failed on table because it is not supported operation on system-versioned temporal tables\",\"How do I find the history of a SQL Server database?\",\"How do temporal tables work?\",\"Introduction to SQL Server Temporal Tables\",\"Memory-optimized temporal tables in SQL Server\",\"temporal table in sql server\",\"Temporal Table Limitations and Restrictions\",\"temporal table with In-Memory\",\"Temporal Tables\",\"temporal tables in memory\",\"Temporal Tables in SQL Server\",\"Temporal Tables Limitations\",\"Temporal Tables Limitations and Restrictions\",\"Temporal Tables Restrictions\",\"Temporal Tables with Memory Optimized Tables\",\"what are temporal tables\",\"what are temporal tables in sql server\",\"What are temporal tables in SQL Server 2016?\",\"what are temporal tables sql\",\"What are the uses of temporal tables choose all that apply?\",\"What are the uses of temporal tables?\",\"What is a Temporal Table\",\"What is a temporal table in SQL Server?\",\"What is history table in SQL Server?\",\"What is temporal table?\",\"What is Temporal Tables\"],\"articleSection\":[\"MSSQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/\",\"url\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/\",\"name\":\"Temporal Tables in SQL Server - Database Tutorials\",\"isPartOf\":{\"@id\":\"https:\/\/dbtut.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-96.png\",\"datePublished\":\"2019-12-03T07:20:13+00:00\",\"dateModified\":\"2019-12-03T07:20:46+00:00\",\"description\":\"Temporal Tables in SQL Server\",\"breadcrumb\":{\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#primaryimage\",\"url\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-96.png\",\"contentUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-96.png\",\"width\":496,\"height\":287},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/dbtut.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Temporal Tables in SQL Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/dbtut.com\/#website\",\"url\":\"https:\/\/dbtut.com\/\",\"name\":\"Database Tutorials\",\"description\":\"MSSQL, Oracle, PostgreSQL, MySQL, MariaDB, DB2, Sybase, Teradata, Big Data, NOSQL, MongoDB, Couchbase, Cassandra, Windows, Linux\",\"publisher\":{\"@id\":\"https:\/\/dbtut.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/dbtut.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/dbtut.com\/#organization\",\"name\":\"dbtut\",\"url\":\"https:\/\/dbtut.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg\",\"contentUrl\":\"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg\",\"width\":223,\"height\":36,\"caption\":\"dbtut\"},\"image\":{\"@id\":\"https:\/\/dbtut.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408\",\"name\":\"dbtut\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/dbtut.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g\",\"caption\":\"dbtut\"},\"description\":\"We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.\",\"sameAs\":[\"http:\/\/NurullahCAKIR\"],\"url\":\"https:\/\/dbtut.com\/index.php\/author\/dbtut\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Temporal Tables in SQL Server - Database Tutorials","description":"Temporal Tables in SQL Server","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:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/","og_locale":"en_US","og_type":"article","og_title":"Temporal Tables in SQL Server - Database Tutorials","og_description":"Temporal Tables in SQL Server","og_url":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/","og_site_name":"Database Tutorials","article_published_time":"2019-12-03T07:20:13+00:00","article_modified_time":"2019-12-03T07:20:46+00:00","og_image":[{"width":496,"height":287,"url":"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-96.png","type":"image\/png"}],"author":"dbtut","twitter_card":"summary_large_image","twitter_misc":{"Written by":"dbtut","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#article","isPartOf":{"@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/"},"author":{"name":"dbtut","@id":"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408"},"headline":"Temporal Tables in SQL Server","datePublished":"2019-12-03T07:20:13+00:00","dateModified":"2019-12-03T07:20:46+00:00","mainEntityOfPage":{"@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/"},"wordCount":1007,"commentCount":0,"publisher":{"@id":"https:\/\/dbtut.com\/#organization"},"image":{"@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-96.png","keywords":["advantages of Temporal Tables","Benefits of Temporal Tables","Create a memory optimized Temporal Table","Create a Memory Optimized Temporal Tables","Create a Temporal Table","Create Memory Optimized Temporal Tables","create temporal tables","Creating a Memory-Optimized System-Versioned Temporal table","Creating a Memory-Optimized System-Versioned Temporal tables","Creating a Memory-Optimized Temporal Table","Drop table operation failed on table 'x' because it is not supported operation on system-versioned temporal tables.","Drop table operation failed on table because it is not supported operation on system-versioned temporal tables","How do I find the history of a SQL Server database?","How do temporal tables work?","Introduction to SQL Server Temporal Tables","Memory-optimized temporal tables in SQL Server","temporal table in sql server","Temporal Table Limitations and Restrictions","temporal table with In-Memory","Temporal Tables","temporal tables in memory","Temporal Tables in SQL Server","Temporal Tables Limitations","Temporal Tables Limitations and Restrictions","Temporal Tables Restrictions","Temporal Tables with Memory Optimized Tables","what are temporal tables","what are temporal tables in sql server","What are temporal tables in SQL Server 2016?","what are temporal tables sql","What are the uses of temporal tables choose all that apply?","What are the uses of temporal tables?","What is a Temporal Table","What is a temporal table in SQL Server?","What is history table in SQL Server?","What is temporal table?","What is Temporal Tables"],"articleSection":["MSSQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/","url":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/","name":"Temporal Tables in SQL Server - Database Tutorials","isPartOf":{"@id":"https:\/\/dbtut.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#primaryimage"},"image":{"@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-96.png","datePublished":"2019-12-03T07:20:13+00:00","dateModified":"2019-12-03T07:20:46+00:00","description":"Temporal Tables in SQL Server","breadcrumb":{"@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#primaryimage","url":"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-96.png","contentUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2019\/11\/Ads\u0131z-96.png","width":496,"height":287},{"@type":"BreadcrumbList","@id":"https:\/\/dbtut.com\/index.php\/2019\/12\/03\/temporal-tables-in-sql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dbtut.com\/"},{"@type":"ListItem","position":2,"name":"Temporal Tables in SQL Server"}]},{"@type":"WebSite","@id":"https:\/\/dbtut.com\/#website","url":"https:\/\/dbtut.com\/","name":"Database Tutorials","description":"MSSQL, Oracle, PostgreSQL, MySQL, MariaDB, DB2, Sybase, Teradata, Big Data, NOSQL, MongoDB, Couchbase, Cassandra, Windows, Linux","publisher":{"@id":"https:\/\/dbtut.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dbtut.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/dbtut.com\/#organization","name":"dbtut","url":"https:\/\/dbtut.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/#\/schema\/logo\/image\/","url":"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg","contentUrl":"https:\/\/dbtut.com\/wp-content\/uploads\/2021\/02\/dbtutlogo.jpg","width":223,"height":36,"caption":"dbtut"},"image":{"@id":"https:\/\/dbtut.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/dbtut.com\/#\/schema\/person\/fc047c39e1e53dce28fc4253529ea408","name":"dbtut","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dbtut.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c322c32021bf651d9e103b183963c479a9c9791ead0715f4348203496c39aa54?s=96&d=mm&r=g","caption":"dbtut"},"description":"We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.","sameAs":["http:\/\/NurullahCAKIR"],"url":"https:\/\/dbtut.com\/index.php\/author\/dbtut\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts\/14085","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/comments?post=14085"}],"version-history":[{"count":0,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/posts\/14085\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/media\/14105"}],"wp:attachment":[{"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/media?parent=14085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/categories?post=14085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dbtut.com\/index.php\/wp-json\/wp\/v2\/tags?post=14085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}