Move data from System-versioned history tables out of database

41 Views Asked by At

We are developing Audit Log feature for SQL Server.

Among all the options available

  1. Tracking Change
  2. CDC
  3. Temporal tables (System-versioned tables)

I find system-versioned to be good and suitable for our use case. It will create history table and we have to query and get the audit logs for the application.

With system-versioned temporal tables, the history table may increase database size more than regular tables.

We want to move this data out of database to some other storage periodically.

To manage retention of historical data in system-versioned temporal tables, it has 4 ways

  1. Stretch table – deprecated
  2. Partitioning – It still will have data in same database
  3. Custom Cleanup script – for that System-Versioning should be set OFF , clean and enable which is manual.
  4. Setting Retention policy at table level - this would clean data in history table but would not backup

Would an ADF Dataflow help with this? How can we achieve this? Is there any built in support that can be used?

We are using SQL Server (it can be on-premise, or Azure-based on client) but I am not looking for Azure SQL specific solution

0

There are 0 best solutions below