We are implementing a solution to query a temporal table.
When enabling a temporal table on SQL server for any table, SQL will automatically add a second table with extra “_History” at the end of the table to track history. For example, if we have a “student” table, SQL server will add “student_History” table.
To query the student history, all that we need is querying student table and add FOR SYSTEM_TIME AS OF '2015-09-01 T10:00:00.7230011';
at the end of the statement.
So instead of write:
Select * from student
We will write:
Select * from student FOR SYSTEM_TIME AS OF '2015-09-01 T10:00:00.7230011'
Is there any way to automatically append this statement at the end of the query?
It is like intercepting the query and applying query filter like a soft table, but now it is not filtered, it is just statement at the end of the statement.