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

前端 未结 22 1485
我在风中等你
我在风中等你 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:37

    you can simply use This statement for example if your table name is School. Before insertion make sure identity_insert is set to ON and after insert query turn identity_insert OFF

    SET IDENTITY_INSERT School ON
    /*
      insert query
      enter code here
    */
    SET IDENTITY_INSERT School OFF
    

提交回复
热议问题