Does SYSTEM_VERSIONING alone give old snapshots of data?

156 views Asked by At

I am new to temporal tables. We have the following table in the database with which we would like to keep track of the CLV values of the customer in time. Here is the CREATE script of the table:

CREATE TABLE [ana].[CLV](
    [CustomerID] [varbinary](400) NOT NULL,
    [Lifetime] [numeric](9, 6) NULL,
    [NumberofOrders] [int] NULL,
    [TotalCLV] [float] NULL,
    [SysStartTime] [datetime2](7) GENERATED ALWAYS AS ROW START NOT NULL,
    [SysEndTime] [datetime2](7) GENERATED ALWAYS AS ROW END NOT NULL,
PRIMARY KEY CLUSTERED 
(
    [CustomerID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
    PERIOD FOR SYSTEM_TIME ([SysStartTime], [SysEndTime])
) ON [PRIMARY]
WITH
(
SYSTEM_VERSIONING = ON ( HISTORY_TABLE = [ana].[CLVHistory] )
)

Using a scheduled MERGE statement we are going to update this table on a weekly or monthly basis. But rather than looking at individual records, we would like to know how the table looked before and after each MERGE. In other words, a point-in-time analysis or snapshot.

When I look at Microsoft's own documentation for time travel, the script seems to contain other parameters such as MEMORY_OPTIMIZED and DATA_CONSISTENCY_CHECK. I am wondering if it is possible to look at old snapshots without these parameters. Is the current structure of the table enough to go back in time?

0

There are 0 answers