January 26, 2006 at 11:50 am
Morning everyone! Next question:
I am doing an insert into a table. There is a foreign key constraint to another table. I am getting an error on the insert. I checked the other table and the PersonID is there, so I don't know why I am getting this error....any help???? here is the error:
Server: Msg 547, Level 16, State 1, Line 163
INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'FK_PersonAllergy_Person'. The conflict occurred in database 'Medicompass31', table 'Person', column 'PersonID'.
The statement has been terminated.
thank you!!
January 26, 2006 at 12:18 pm
what kind of field is PersonId? char, varchar, int?
Are you checking the right table? (have you specified an owner like dbo)
January 26, 2006 at 12:33 pm
We'd need to see the DDL code (CREATE TABLE statements).
You might already know this, but in Query Analyzer, if you make the Object Browser visible, you can drill down to the table(s), right click on the table, select "Script Object to Clipboard as Create" and then paste this code.
Then we can debug with you.
January 27, 2006 at 12:08 am
Can you specify the primary key of the parent table.
I guess the column in the child table is not accepting any nulls.
..hema
January 27, 2006 at 11:34 am
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply