?
Solved

DTS Error...COLUMN FOREIGN KEY constraint...Excel to SQL or SQL to SQL

Posted on 2005-03-28
4
Medium Priority
?
344 Views
Last Modified: 2008-03-10
I am trying to copy 2 fields from a table into a different table in the same database.  Using the DTS I match up the columns and proceed with the copy.  It throws an error  (INSERT statement conflicted with COLUMN FOREIGN KEY constraint 'XXXXX'...."  The error in on the on the very last line in the column.  I have tried importing from Excel as well...Same conflict... How do I force it to copy this information over???


Thankyou
Robert Zordel
Dataentity, LLC
0
Comment
Question by:dataentity
  • 2
4 Comments
 
LVL 34

Expert Comment

by:Brian Crowe
ID: 13648136
determine which foreign key you are conflicting with and either disable it or conform.
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 1400 total points
ID: 13648142
>>How do I force it to copy this information over???<<
Without making any changes you cannot.  Simply put it is violating a relationship between the two tables.  

I suspect the problem is an EOF character at the end. So as a workaround consider opening it with a text editor and confirming that is the case, prior to removing that row.  If you do not like the idea of deleting the row, consider using a VIEW to filter it out.
0
 

Author Comment

by:dataentity
ID: 13652792
How would I create a VIEW to filter it out?   I think your right on the EOF character, but it might just be easier to delete the row and then manually add it back in.  I am only using 2 columns after all.  What do you think?
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 13652927
>>How would I create a VIEW to filter it out?  <<
Post the structure of the table.

>> but it might just be easier to delete the row <<
I agree.

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question