Add history tracking to the existing table
alter table tbl_event2 add SysStartTime datetime2 generated always as row start not null default getutcdate(), SysEndTime datetime2 generated always as row end not null default convert(datetime2, '9999-12-31 23:59:59.9999999'), period for system_time (SysStartTime, SysEndTime); alter table tbl_event2 set (system_versioning = on (HISTORY_TABLE = dbo.tbl_event2_history));
No comments:
Post a Comment