An explicit value for the identity column in table 'Table' can only be specified when a column list is used and IDENTITY_INSERT is ON

前端 未结 3 1960
一整个雨季
一整个雨季 2021-01-25 14:52

Does someone know what this error (An explicit value for the identity column in table \'HD_AANVRAAG_FASE\' can only be specified when a column list is used and IDENTITY_INSERT

3条回答
  •  青春惊慌失措
    2021-01-25 15:16

    You're missing a

    SET IDENTITY_INSERT HD_AANVRAAG_FASE ON
    

    before you run your insert. That's the exact cause of the error.

    That said, inserting identity values explicitly is rare-- for example, used only when copying data from one table to another, or initializing a new table with explicit IDs. Usually you'll just want to omit identity values from your INSERT, which also avoids the error.

提交回复
热议问题