Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 The INSERT statement conflicted with the FOREIGN K

Author  Topic 

kwikwisi
Constraint Violating Yak Guru

283 Posts

Posted - 2011-07-06 : 11:02:59
What does the following statement mean ?

The INSERT statement conflicted with the FOREIGN KEY constraint
"Owner_unit_amak_assignmenthistory". The conflict occurred in database "PRM_MSCRM",
table "dbo.OwnwerUnit", column 'OwnerUnitId'.
The statement has been terminated.

Thanks

nigelrivett
Master Smack Fu Yak Hacker

3385 Posts

Posted - 2011-07-06 : 11:06:03
It means theres a foreign key on OwnerUnitId - you aren't allowed to add values that don't appear in another table.
Have a look at Owner_unit_amak_assignmenthistory and see what the constraint is - you either have an incorrect value or need to add it.

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page
   

- Advertisement -