Skip to content

Migrations: InsertData() causes error "Table 'table_name' does not have the identity property. Cannot perform SET operation." #8618

@divega

Description

@divega

Our implementation for SQL Server is incorrect because SET IDENTITY_INSERT table_name ON is only valid when the table does actually have an identity column. I see a few options:

  1. Have a flag indicating if the statement should be generated
  2. Have a separate method e.g. InsertDataOverridingIdentity 😸
  3. Query for schema metadata in the SQL (might not work if we don't have enough permissions).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions