By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,741 Members | 2,033 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,741 IT Pros & Developers. It's quick & easy.

the insert statement conflicted with the foreign key constraint fk_

P: 11
i have two tables projects and proposals
in project I have column ID and in proposal I have column ID too and there is a one to one realtionship between these tables the primary key in this realtion is the project.ID and foreign key is in proposal.ID
and thses tow column proposal.ID and project.id does not allow null.
the problem is there is an erorr while I'm trying to insert to proposal table the error is:
the insert statement conflicted with the foreign key constraint "fk_PRoposal_project" the conflict occured in data base "Sc" table "dbo.project" , column 'ID'please help with problem
Thank you...
Aug 10 '10 #1

✓ answered by NeoPa

Hi Bougie. Welcome to Bytes!

You say you have a 1:1 relationship defined. Are you sure? This is quite unusual. Are you sure you don't mean a 1:Many relationship (which is far more common)?

When providing an error for help, it is never much good to supply just the error message. It's important to provide it of course, but we would generally need some sort of indication of exactly what is going on when it occurred. Only you know your situation but I would expect the T-SQL that was running when it occurred would be a bare minimum. Data may be required depending on the specific problem.

Share this Question
Share on Google+
1 Reply


NeoPa
Expert Mod 15k+
P: 31,489
Hi Bougie. Welcome to Bytes!

You say you have a 1:1 relationship defined. Are you sure? This is quite unusual. Are you sure you don't mean a 1:Many relationship (which is far more common)?

When providing an error for help, it is never much good to supply just the error message. It's important to provide it of course, but we would generally need some sort of indication of exactly what is going on when it occurred. Only you know your situation but I would expect the T-SQL that was running when it occurred would be a bare minimum. Data may be required depending on the specific problem.
Aug 10 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.