{"id":82199,"date":"2016-05-21T21:52:32","date_gmt":"2016-05-21T21:52:32","guid":{"rendered":"https:\/\/www.webstaging.red-gate.com\/simple-talk\/?p=73592"},"modified":"2018-12-12T11:12:48","modified_gmt":"2018-12-12T11:12:48","slug":"temporal-tables-part-5-start-and-end-type-precision","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/temporal-tables-part-5-start-and-end-type-precision\/","title":{"rendered":"Temporal Tables &#8211; Part 5 &#8211; Start and End Type Precision"},"content":{"rendered":"<p>In this fifth (and maybe final until at least getting to the concurrency chapter prep) blog about temporal I wanted to briefly cover the precision of the ROW START and END times. You can use any of the datetime2 types for these values. The precision will let you choose how many changes would be seen by the user. Even with 6 digits of precision from datetime2(7), there is no guarantee that every change will be visible to the user via the temporal settings on a FROM clause, but it is generally much more likely than if you are using datetime2(0) as we will see.<\/p>\n<p>In this blog, I will use datetime2(0) to give the least possible precision possible to show what can occur. Note that (not unsurprisingly) you have to use the same precision for both ROW START and END times or you get the following error:<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true \">Msg 13513, Level 16, State 1, Line 6\nSYSTEM_TIME period columns cannot have different datatype precision.<\/pre>\n<p>I will use the same basic structures I have used in previous examples, so if you have created the tables, you will need to drop the table and the history table:<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true \">ALTER TABLE Sales.SalesOrder\n\u00a0\u00a0\u00a0 SET (SYSTEM_VERSIONING = OFF);\ngo\nDROP TABLE Sales.SalesOrder;\nDROP TABLE Sales.SalesOrderHistory;\nGO<\/pre>\n<p>To generate some data, I will use SEQUENCE object that I will format to put out a hexedecimal value, which I will put into a default constraint so the repeating code will be easier to read.<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true\">CREATE SEQUENCE Sales.SalesOrderData_SEQUENCE MINVALUE 1 START WITH 1;\nGO\nCREATE TABLE Sales.SalesOrder\n(\u00a0\n\u00a0\u00a0\u00a0 SalesOrderId int NOT NULL CONSTRAINT PKSalesOrder PRIMARY KEY,\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 --default to a text hex value, so we can see changes...\n\u00a0\u00a0\u00a0 Data varchar(30) NOT NULL DEFAULT (SUBSTRING(CONVERT(varchar(20), cast(NEXT VALUE FOR Sales.SalesOrderData_SEQUENCE as varbinary(5)), 1),3,12)),\n\u00a0\u00a0\u00a0 ValidStartTime datetime2 (0) GENERATED ALWAYS AS ROW START,\n\u00a0\u00a0\u00a0 ValidEndTime datetime2 (0) GENERATED ALWAYS AS ROW END,\n\u00a0\u00a0\u00a0 PERIOD FOR SYSTEM_TIME (ValidStartTime, ValidEndTime)\n)\u00a0\nWITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE = Sales.SalesOrderHistory)); --Another future thought, put in a different schema? I think not, but, it intrigues me nonetheless. <\/pre>\n<p>Next let&#8217;s create a sequence of history rows, starting with a simple insert, wait a second, then three sets of 5 inserts.<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true \">--create a first row\nINSERT INTO Sales.SalesOrder(SalesOrderId, Data)\nVALUES (1, DEFAULT);\n\nWAITFOR DELAY '00:00:01';\nGO\n--update the table 5 times\nUPDATE\u00a0 Sales.SalesOrder\nSET\u00a0\u00a0\u00a0\u00a0 Data = DEFAULT\nWHERE\u00a0\u00a0 SalesOrderId = 1;\nGO 5\nWAITFOR DELAY '00:00:01';\nGO\n--update the table 5 more times\nUPDATE\u00a0 Sales.SalesOrder\nSET\u00a0\u00a0\u00a0\u00a0 Data = DEFAULT\nWHERE\u00a0\u00a0 SalesOrderId = 1;\nGO 5\nWAITFOR DELAY '00:00:01';\nGO\n--update the table 5 last times\nUPDATE\u00a0 Sales.SalesOrder\nSET\u00a0\u00a0\u00a0\u00a0 Data = DEFAULT\nWHERE\u00a0\u00a0 SalesOrderId = 1;\nGO 5\n\nNow, checking out the data:\n\nSELECT\u00a0 *\nFROM\u00a0\u00a0\u00a0 Sales.SalesOrder\nWHERE\u00a0\u00a0 SalesOrderId = 1;\nSELECT\u00a0 *\nFROM\u00a0\u00a0\u00a0 Sales.SalesOrderHistory\nWHERE\u00a0\u00a0 SalesOrderId = 1;<\/pre>\n<p>The final state of the row has the Data column = &#8216;0000000010&#8217;, and you can see the complete progression from &#8216;0000000001&#8217; through &#8216;000000000F&#8217;.<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true\">SalesOrderId Data\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ValidStartTime\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ValidEndTime\n------------ ------------------------------ --------------------------- ---------------------------\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000010\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:12\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9999-12-31 23:59:59\n\nSalesOrderId Data\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ValidStartTime\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ValidEndTime\n------------ ------------------------------ --------------------------- ---------------------------\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000001\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:09\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000002\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000003\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000004\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000005\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000006\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000007\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000008\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000009\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 000000000A\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 000000000B\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:12\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 000000000C\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:12\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:12\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 000000000D\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:12\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:12\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 000000000E\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:12\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:12\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 000000000F\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:12\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:12<\/pre>\n<p>Starting at the first second that was recorded, the first thing you can see is the row where Data = &#8216;0000000001&#8217;:<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true \">SELECT *\nFROM\u00a0\u00a0 Sales.SalesOrder FOR SYSTEM_TIME\u00a0 AS OF '2016-05-02 02:53:09';\n\nSalesOrderId Data\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ValidStartTime\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ValidEndTime\n------------ ------------------------------ --------------------------- ---------------------------\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000001\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:09\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10<\/pre>\n<p>But the next row you will see will not be &#8216;0000000002&#8217;, it will actually be &#8216;0000000006&#8217;. Using fractional times will be truncated. Such as if we try &#8216;2016-05-02 02:53:09.9&#8217;.<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true \">SELECT *\nFROM\u00a0\u00a0 Sales.SalesOrder FOR SYSTEM_TIME\u00a0 AS OF '2016-05-02 02:53:09.9';<\/pre>\n<p>This returns the same thing that 2016-05-02 02:53:09 does:<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true \">SalesOrderId Data\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ValidStartTime\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ValidEndTime\n------------ ------------------------------ --------------------------- ---------------------------\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000001\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:09\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10<\/pre>\n<p>If you use the next second, you will get &#8216;0000000006&#8217;:<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true \">SELECT *\nFROM\u00a0\u00a0 Sales.SalesOrder FOR SYSTEM_TIME\u00a0 AS OF '2016-05-02 02:53:10'<\/pre>\n<p>This returns:<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true \">SalesOrderId Data\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ValidStartTime\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ValidEndTime\n------------ ------------------------------ --------------------------- ---------------------------\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000006\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11<\/pre>\n<p>The only way you will see rows &#8216;0000000001&#8217; &#8211; &#8216;0000000005&#8217; is to query the history table. We can only see rows where ValidStartTime &lt;&gt; ValidEndTime. In the following query I will get all of the rows that you can see in the table using each second:<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true \">SELECT *\nFROM\u00a0\u00a0 Sales.SalesOrder FOR SYSTEM_TIME\u00a0 AS OF '2016-05-02 02:53:09'\nUNION ALL\nSELECT *\nFROM\u00a0\u00a0 Sales.SalesOrder FOR SYSTEM_TIME\u00a0 AS OF '2016-05-02 02:53:10'\nUNION ALL\nSELECT *\nFROM\u00a0\u00a0 Sales.SalesOrder FOR SYSTEM_TIME\u00a0 AS OF '2016-05-02 02:53:11'\nUNION ALL\nSELECT *\nFROM\u00a0\u00a0 Sales.SalesOrder FOR SYSTEM_TIME\u00a0 AS OF '2016-05-02 02:53:12';<\/pre>\n<p>Which returns:<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true\">SalesOrderId Data\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ValidStartTime\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ValidEndTime\n------------ ------------------------------ --------------------------- ---------------------------\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000001\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:09\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000006\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:10\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 000000000B\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:11\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:12\n1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0000000010\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 2016-05-02 02:53:12\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 9999-12-31 23:59:59<\/pre>\n<p>Note that this is the same output you will see if you execute the following query that returns all data:<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true \">SELECT *\nFROM\u00a0\u00a0 Sales.SalesOrder FOR SYSTEM_TIME CONTAINED IN ('1900-01-01','9999-12-31 23:59:59.9999999');<\/pre>\n<p>Or<\/p>\n<pre class=\"theme:ssms2012-simple-talk lang:tsql decode:true \">SELECT *\nFROM\u00a0\u00a0 Sales.SalesOrder FOR SYSTEM_TIME ALL;<\/pre>\n<p>So you will definitely want to set your precision to the level that you will have the most likelihood of seeing all changes in your data. Once multiple connections are making simultaneous changes, you wouldn&#8217;t wnt to lose data that would be interesting to the user.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this fifth (and maybe final until at least getting to the concurrency chapter prep) blog about temporal I wanted to briefly cover the precision of the ROW START and END times. You can use any of the datetime2 types for these values. The precision will let you choose how many changes would be seen&#8230;&hellip;<\/p>\n","protected":false},"author":56085,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[],"coauthors":[19684],"class_list":["post-82199","post","type-post","status-publish","format-standard","hentry","category-blogs"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/82199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/56085"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=82199"}],"version-history":[{"count":1,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/82199\/revisions"}],"predecessor-version":[{"id":82200,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/82199\/revisions\/82200"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=82199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=82199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=82199"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=82199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}