In the previous post, we have discussed the temporal table, which is introduced in SQL Server 2016 to store the time varying data (current data and the data change history along with the time period). There, we have also learnt how we can create a temporal table from scratch.
In this post “Convert existing table to temporal table“, we are going to learn how we can convert an existing table to a temporal table. For the demo purpose we are using a dummy employee table, created with a very small subset of the data taken from HumanResources.Employee table of adventure works database.
Below is the dummy table which needs to be converted in a temporal table:
We can use below script to create the above sample table with the data for demo purpose:
Convert existing table to temporal table – Step by step
We are going to … More