Insert auto-incrementing ID cannot be specified when IDENTITY_INSERT is set to OFF

When IDENTITY_INSERT is set to OFF, you cannot specify an ID to insert into an auto-incrementing ID column. At this point you need: "SET IDENTITY_INSERT [DBSchema].[dbo].[TableName] ON" to enable inserting custom IDs.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326392821&siteId=291194637