dbTalk Databases Forums  

DTS Error of Foreign Key

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


Discuss DTS Error of Foreign Key in the microsoft.public.sqlserver.dts forum.



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

Default DTS Error of Foreign Key - 11-05-2003 , 10:38 AM






I am trying to run a DTS package that basically copies an
entire database to another location. But it runs until
it gives me this error:

"ALTER TABLE statement conflicted with TABLE FOREIGN KEY
constraint 'cimalloc_fkc1'. The conflict occurred in
database 'CIM_BU', table 'SMPKDT'."

I think i understand the error but is there an easy way to
either see what the constrant is looking at? (What
fields?) Or what data is not meeting the Foreign Key
constraint?

I am just learning SQL (and databases for that matter) so
please be gentle with your answer... THANKS IN ADVANCE!!!

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

Default Re: DTS Error of Foreign Key - 11-06-2003 , 04:06 PM






OK

You are looking in database 'CIM_BU' and table 'SMPKDT'. You are looking
for a constraint called 'cimalloc_fkc1'

Have a look at the sysreferences table to find out which columns are being
referenced by which tables

select
OBJECT_NAME(constID) as ConstraintName,
OBJECT_NAME(fkeyID) as referencedTable,
OBJECT_NAME(rkeyID) as referencingTable,
col_name(fkeyid,fkey1) as ReferencedColumn,
col_name(rkeyid,rkey1) as referencingColumn
from sysreferences



--
--

Allan Mitchell (Microsoft SQL Server MVP)
MCSE,MCDBA
www.SQLDTS.com
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org

"Chip Melton" <cmelton (AT) choctawnation (DOT) com> wrote

Quote:
I am trying to run a DTS package that basically copies an
entire database to another location. But it runs until
it gives me this error:

"ALTER TABLE statement conflicted with TABLE FOREIGN KEY
constraint 'cimalloc_fkc1'. The conflict occurred in
database 'CIM_BU', table 'SMPKDT'."

I think i understand the error but is there an easy way to
either see what the constrant is looking at? (What
fields?) Or what data is not meeting the Foreign Key
constraint?

I am just learning SQL (and databases for that matter) so
please be gentle with your answer... THANKS IN ADVANCE!!!



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.