Using simple insert statement I'm trying to insert data in a table explicitly with PK keys that have an Identity property defined on itself. But when I run the statement below I'm getting a weird error message
SET IDENTITY_INSERT MyDB.dbo.MyTable ON
Msg 8107, Level 16, State 1, Line 163
IDENTITY_INSERT is already ON for table 'MyDB.dbo.AnotherTable'. Cannot perform SET operation for table 'MyDB.dbo.MyTable '.
Why is it complaining on MyDB.dbo.AnotherTable
when this Identity_Insert
is specified being specified for MyDB.dbo.MyTable
?
Some other tables also give similar error.