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

identity, sql-server

Solution

You have to specify the columns in the insert statement

Problem

don't know why this code is not executing... ``` SET IDENTITY_INSERT COM_MST ON GO INSERT INTO COM_MST SELECT * FROM COM_MST_DEL ``` and showing an error ``` An explicit value for the identity column in table 'COM_MST' can only be specified when a column list is used and IDENTITY_INSERT is ON. ```

Original source

Related problems