Sample Header Ad - 728x90

How to check if the SYSTEM_VERSIONING for a table is ON?

13 votes
2 answers
12346 views
I know that SQL Server 2016 let us to use the SYSTEM_VERSIONING like : CREATE TABLE EmpSalary ( EmpID int NOT NULL PRIMARY KEY CLUSTERED , SalaryAmt decimal (10,2) NULL , SalaryBeginDT datetime2 GENERATED ALWAYS AS ROW START NOT NULL , SalaryEndDT datetime2 GENERATED ALWAYS AS ROW END NOT NULL , PERIOD FOR SYSTEM_TIME (SalaryBeginDT, SalaryEndDT) ) WITH (SYSTEM_VERSIONING = ON); Also to deactivate this, it is only necessary to ALTER the table: ALTER TABLE EmpSalary SET (SYSTEM_VERSIONING = OFF ); My question is how to check if the SYSTEM_VERSIONING for a table is ON and then ALTER the table?
Asked by eandbsoftware (131 rep)
Sep 25, 2018, 02:29 PM
Last activity: Nov 9, 2019, 12:03 AM