473,418 Members | 2,053 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

the insert statement conflicted with the foreign key constraint fk_

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.

1 3803
NeoPa
32,556 Expert Mod 16PB
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

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

Similar topics

3
by: J. Muenchbourg | last post by:
The block of code below shows how I am inserting field values into my dbase table: strSQLStatement = "INSERT INTO tblArticles (handid,ArticleDate,sport,articleheader, fpick,articleText) "_ &...
2
by: Tim::.. | last post by:
Can someone please tell me why I keep getting the following error from the code below! Error: INSERT statement conflicted with COLUMN FOREIGN KEY constraint...
2
by: Geoffrey KRETZ | last post by:
Hello, I'm wondering if the following behaviour is the correct one for PostGreSQL (7.4 on UNIX). I've a table temp_tab with 5 fields (f1,f2,f3,...),and I'm a launching the following request :...
7
by: Cindy H | last post by:
Hi I'm having a problem getting the insert statement correct for an Access table I'm using. The Access table uses an autonumber for the primary key. I have tried this: INSERT INTO Tournaments...
3
by: rhaazy | last post by:
Using ms sql 2000 I have 2 tables. I have a table which has information regarding a computer scan. Each record in this table has a column called MAC which is the unique ID for each Scan. The...
0
by: macupryk | last post by:
{System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_ProjectResponse__ProjectQuestionId". The conflict occurred in database "RG_ProjectData", table...
1
by: filip1150 | last post by:
I'm trying to find if there is any performance diference between explicitly using a sequence in the insert statement to generate values for a column and doing this in an insert trigger. I...
3
by: weird0 | last post by:
I have two tables accounts and ATM and i am trying to insert a tuple in ATM with accountId as foreign key. But even this simple work,I encounter the following error: The INSERT statement...
3
by: haiminnu | last post by:
I have created Two tables 1]EmployeeTable -------------------------- EmpID EmpName AccessLevelID ...
2
by: ksenthilbabu | last post by:
Hey All, I am using MSSQL -2005 with VB6. I have created a master table tblCompany and detail Table tblDetail having foreign key relationship. When i try to insert a value within a TRANSACTION I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.