I like temporal tables in SQL Server 2016 and I want to use this in a new project. Unfortunately, it seems that sql is logging UTC time in history table, not the current time. It is possible to change this ?
To see what I mean, please run the following code and notice the difference from CreatedIn and SysStartTime columns.
CREATE TABLE dbo.tblTest
(
ID int NOT NULL PRIMARY KEY CLUSTERED IDENTITY (1,1)
,SomeColumn varchar(50) NULL
,CreatedIn datetime2(2) NOT NULL DEFAULT GETDATE()
,SysStartTime datetime2(2) GENERATED ALWAYS AS ROW START NOT NULL DEFAULT GETDATE()
,SysEndTime datetime2(2) GENERATED ALWAYS AS ROW END NOT NULL
,PERIOD FOR SYSTEM_TIME (SysStartTime, SysEndTime)
)
WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE = dbo.tblTestHistory));
GO
INSERT INTO dbo.tblTest (SomeColumn) VALUES ('Some value');
GO
SELECT * FROM dbo.tblTest