dbTalk Databases Forums  

Foreign Key Conflict

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Foreign Key Conflict in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Emma
 
Posts: n/a

Default Foreign Key Conflict - 01-26-2005 , 01:19 PM






I am importing data from one database to another using DTS. During the
importation process, I get the following error message:

INSERT statement conflicted with COLUMN FOREIGH KEY constraint.
“FK_foot_Gen”. The conflict occurred in database ‘Sales’, table ‘Gen’, column
‘ID’

There are 50 tables in the database and seven returned similar message.

How can I determine which records are causing the conflicts and how do I
prevent this from happening again?

Thanks


Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Foreign Key Conflict - 01-26-2005 , 02:00 PM






OK

If you know the data is clean then you can drop the relationships between
the tables during load and then reapply afterwards.

You could also try to order the import process through precendence
constraints to the correct order for your tables.

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Emma" <Emma (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am importing data from one database to another using DTS. During the
importation process, I get the following error message:

INSERT statement conflicted with COLUMN FOREIGH KEY constraint.
"FK_foot_Gen". The conflict occurred in database 'Sales', table 'Gen',
column
'ID'

There are 50 tables in the database and seven returned similar message.

How can I determine which records are causing the conflicts and how do I
prevent this from happening again?

Thanks




Reply With Quote
  #3  
Old   
Emma
 
Posts: n/a

Default Re: Foreign Key Conflict - 01-26-2005 , 02:21 PM



Thanks for your response. I do not know if the data is clean. It is very
possible that it is not. What is precendence constraints?

"Allan Mitchell" wrote:

Quote:
OK

If you know the data is clean then you can drop the relationships between
the tables during load and then reapply afterwards.

You could also try to order the import process through precendence
constraints to the correct order for your tables.

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Emma" <Emma (AT) discussions (DOT) microsoft.com> wrote in message
news:243CFD14-5897-4481-AB38-5AA684703FEF (AT) microsoft (DOT) com...
I am importing data from one database to another using DTS. During the
importation process, I get the following error message:

INSERT statement conflicted with COLUMN FOREIGH KEY constraint.
"FK_foot_Gen". The conflict occurred in database 'Sales', table 'Gen',
column
'ID'

There are 50 tables in the database and seven returned similar message.

How can I determine which records are causing the conflicts and how do I
prevent this from happening again?

Thanks





Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Foreign Key Conflict - 01-26-2005 , 04:02 PM



Introduction to Workflow
(http://www.sqldts.com/default.aspx?287)

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
www.konesans.com - Consultancy from the people who know


"Emma" <Emma (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thanks for your response. I do not know if the data is clean. It is very
possible that it is not. What is precendence constraints?

"Allan Mitchell" wrote:

OK

If you know the data is clean then you can drop the relationships between
the tables during load and then reapply afterwards.

You could also try to order the import process through precendence
constraints to the correct order for your tables.

--



Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
www.SQLIS.com - You thought DTS was good. here we show you the new
stuff.
www.konesans.com - Consultancy from the people who know


"Emma" <Emma (AT) discussions (DOT) microsoft.com> wrote in message
news:243CFD14-5897-4481-AB38-5AA684703FEF (AT) microsoft (DOT) com...
I am importing data from one database to another using DTS. During the
importation process, I get the following error message:

INSERT statement conflicted with COLUMN FOREIGH KEY constraint.
"FK_foot_Gen". The conflict occurred in database 'Sales', table 'Gen',
column
'ID'

There are 50 tables in the database and seven returned similar message.

How can I determine which records are causing the conflicts and how do
I
prevent this from happening again?

Thanks







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.