※ Download: The insert statement conflicted with the foreign key constraint the conflict occurred in database


But many insert operation into this table can be going on in parallel. Hello, Have you seen this blog If there are lots of packages reported in the log, call MS support would be a good choice. It doesn't solve the problem but it makes it go green..


Load 'TODO: This line of code loads data into the 'PIFDataSet. INSERT INTO USERPERSONALDETAIL USERID,FIRSTNAME,LASTNAME,MOBILENO VALUES ' your select query data', ' test', ' test', ' xxxx' you have to tack care of relation ship while using parent child relation in database... RT14 files in the policypv. You can't edit HTML code.


- ThrowExceptionAndWarning TdsParserStateObject stateObj at System. Iain who edited my last sentence out.


Hi all, I get this error when inserting data... The statement has been terminated. Does anyone know how can we solve this? As the error states, you cannot have values in FK table, if it does not exist in Primary Key Table. Do you have '' - value in your primary key - which would be Activity, log provider and participant profile table. To fix this, instead of '' use NULL, assuming your FK columns are NULLable. I'll just make a bunch of assumptions here in an attempt to point you in the right direction. It appears that the problem is with your first select statment... As the error states, you cannot have values in FK table, if it does not exist in Primary Key Table. Do you have '' - value in your primary key - which would be Activity, log provider and participant profile table. To fix this, instead of '' use NULL, assuming your FK columns are NULLable. I bet it would be complaining about NULL values inserted to column which doesnt allow NULLs this time. FK column doesn't allow NULL values. I tried using NULL instead of ''. But it shows the same error. Hello ShyamReddy, As you stated above, if your columns does not allow nulls and if you try to insert nulls,what would you except? Again, FK columns can take nulls but only if they are defined as null in yout Table DDL. Also, '' and NULL are different. So, solution is either make sure your have this '' value in your primary table or make your FK columns as NULL. I would recommend the later though. Please post your Table DDL's for more accurate info. Without your Table's DDL , we are only but guessing the solution which in your case is not that bad since there are only two probable solutions. I have never quite understood the need for FK Constraint columns to allow NULLs. Surely the intention of having a PK-FK relationship is to ensure that a record in the FK table can determine it's PK parent via some value, isn't it? If this is a requirement, I would suggest there is something amiss in the basic DB design that needs to be addressed. I have never quite understood the need for FK Constraint columns to allow NULLs. Surely the intention of having a PK-FK relationship is to ensure that a record in the FK table can determine it's PK parent via some value, isn't it? But who says that there has to be a parent? For instance, a table like OrderDetails may have a column CampaignID. But not order lines are due to campgaigns, so in many cases CampaignID is null. But if it has a value, it needs to be an existing campaign. Erland Sommarskog, SQL Server MVP, esquel sommarskog. What does it means? I know it is database problem.

 


Innovartis Embarcadero SQL Sentry Sonasoft Golden Gate Software Lumigent Red Gate Software Quest Software ApexSQL Idera Discussions about Books Discuss Programming Books Discuss XML Books Discuss T-SQL Books Discuss Data Warehousing Books Discuss DTS Books Discuss SQL Server 7. This is the reason you are getting the error. This has worked, but the problem seems to sometimes return. You can't post new polls. You can download attachments. You can't upload attachments. Please remember to mark the replies as answers if they help and unmark them if they provide no help. Maybe it is a difference in data level. Was the FK on DocumentChild1 created AFTER there was data in the table. You can post emoticons. One more question, it is for my interest. I bet it would be complaining about NULL values inserted to column which doesnt allow NULLs this time.