Observations: ALTER TABLE statement conflict

If you add another table to your project with 1-to-many relationships you may meet an error sound like:

The ALTER TABLE statement conflicted with the FOREIGN KEY constraint “FK_dbo.tableModels_dbo.idModels_admIdModelsId”. The conflict occurred in database “aspnet-dwmp1-20170323101827”, table “dbo.tableModels”, column ‘IdModelsId’.

Solved of this problem lies in content of table where you hook up your new table. In other words: delete content from your old table before you connect new one.

Leave a Reply

Your email address will not be published. Required fields are marked *