Skip to content

InsertBatch批量插入,未过滤自增主键,导致插入失败 #2

@BlueHejp

Description

@BlueHejp

InsertBatch-批量插入,未过滤自增主键(Map(m => m.Id).Key(KeyType.Identity).Description("主键");),导致插入失败。
报错:
System.Data.SqlClient.SqlException:“违反了 PRIMARY KEY 约束“PK_Sys_User”。不能在对象“dbo.Sys_User”中插入重复键。重复键值为 (0)。
语句已终止。”

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions