Cannot insert explicit value for identity column in table 'table' when IDENTITY_INSERT is set to OFF

前端 未结 22 1505
我在风中等你
我在风中等你 2020-11-22 13:56

I have the below error when I execute the following script. What is the error about, and how it can be resolved?

Insert table(OperationID,OpDescription,Filte         


        
22条回答
  •  天涯浪人
    2020-11-22 14:51

    There is pre-mentioned OperationId in your query which should not be there as it is auto increamented

    Insert table(OperationID,OpDescription,FilterID)
    values (20,'Hierachy Update',1)
    

    so your query will be

    Insert table(OpDescription,FilterID)
    values ('Hierachy Update',1)
    

提交回复
热议问题