Querying temporal data in SQL Server 2017

System-versioned tables are primarily intended for tracking historical data changes. Queries on system-versioned tables often tend to be concerned with retrieving table content as of a given point in time, or between any two given points in time. As you saw, Microsoft has implemented them according to the SQL:2011 standard, which means that two physical tables exist: a table with actual data and a history table. In order to simplify queries against temporal tables, the SQL:2011 standard introduced a new SQL clause, FOR SYSTEM_TIME. In addition to it, some new temporal-specific sub-clauses have been added too. SQL Server 2017 has not only implemented these extensions, but added two more extensions. Here is the complete list of clauses and extensions you can use to query temporal data in SQL Server 2017:

  • FOR SYSTEM_TIME AS OF
  • FOR SYSTEM_TIME FROM TO
  • FOR SYSTEM_TIME BETWEEN AND
  • FOR SYSTEM TIME CONTAINED_IN
  • FOR SYSTEM_TIME ALL
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.131.38.14