temporal-tables

Error when inserting into temporal table using Entity Framework Core 2.1

断了今生、忘了曾经 提交于 2019-12-08 02:27:03
问题 I'm getting the below error when trying to insert into a temporal table using Entity Framework Core 2.1. Cannot insert an explicit value into a GENERATED ALWAYS column in table 'db_test.dbo.Department'. Use INSERT with a column list to exclude the GENERATED ALWAYS column, or insert a DEFAULT into GENERATED ALWAYS column. Below is my table schema CREATE TABLE Department ( DeptID int NOT NULL PRIMARY KEY CLUSTERED, DeptName varchar(50) NOT NULL, ManagerID INT NULL, ParentDeptID int NULL,

Error when inserting into temporal table using Entity Framework Core 2.1

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 04:13:21
I'm getting the below error when trying to insert into a temporal table using Entity Framework Core 2.1. Cannot insert an explicit value into a GENERATED ALWAYS column in table 'db_test.dbo.Department'. Use INSERT with a column list to exclude the GENERATED ALWAYS column, or insert a DEFAULT into GENERATED ALWAYS column. Below is my table schema CREATE TABLE Department ( DeptID int NOT NULL PRIMARY KEY CLUSTERED, DeptName varchar(50) NOT NULL, ManagerID INT NULL, ParentDeptID int NULL, SysStartTime datetime2 GENERATED ALWAYS AS ROW START NOT NULL, SysEndTime datetime2 GENERATED ALWAYS AS ROW