dbTalk Databases Forums  

problem: foreign key constraints - referential integrity

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


Discuss problem: foreign key constraints - referential integrity in the microsoft.public.sqlserver.dts forum.



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

Default problem: foreign key constraints - referential integrity - 09-06-2005 , 11:10 AM






We've just performed a DTS copy objects and data from the production server
to the development server, but the DTS failed on updating the referential
integrity.

The following error is reported with the specific names of the database, fk,
table, and column replaced with generics in brackets:

Step Error Source: Microsoft SQL-DMO (ODBC SQLState: 23000)
Step Error Description:[Microsoft][ODBC SQL Server Driver][SQL Server]ALTER
TABLE statement conflicted with COLUMN FOREIGN KEY constraint 'FK_[foreign
key]'. The conflict occurred in database '[database]', table '[Table]',
column '[Column]'.
Step Error code: 80040223
Step Error Help File:SQLDMO80.hlp
Step Error Help Context ID:1131


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

Default Re: problem: foreign key constraints - referential integrity - 09-06-2005 , 01:17 PM






What this is telling you is that the constraint cannot be applied
because there is data in the child that does not have a link to the
parent.

I presume this DRI is in the Source so what is probably happening is one
of the following

The contraint is being applied before the parent is filled
The constraint was not enabled in the source hence why you have the data
in the source

Are you copying all tables? I would use BACKUP/RESTORE

Allan


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


Quote:
We've just performed a DTS copy objects and data from the production
server
to the development server, but the DTS failed on updating the
referential
integrity.

The following error is reported with the specific names of the database,
fk,
table, and column replaced with generics in brackets:

Step Error Source: Microsoft SQL-DMO (ODBC SQLState: 23000)
Step Error Description:[Microsoft][ODBC SQL Server Driver][SQL
Server]ALTER
TABLE statement conflicted with COLUMN FOREIGN KEY constraint
'FK_[foreign
key]'. The conflict occurred in database '[database]', table '[Table]',
column '[Column]'.
Step Error code: 80040223
Step Error Help File:SQLDMO80.hlp
Step Error Help Context ID:1131


Reply With Quote
  #3  
Old   
ND Developer
 
Posts: n/a

Default Re: problem: foreign key constraints - referential integrity - 09-07-2005 , 12:56 PM



Thanks Allan,

We are currently doing a BACKUP/RESTORE

"Allan Mitchell" wrote:

Quote:
What this is telling you is that the constraint cannot be applied
because there is data in the child that does not have a link to the
parent.

I presume this DRI is in the Source so what is probably happening is one
of the following

The contraint is being applied before the parent is filled
The constraint was not enabled in the source hence why you have the data
in the source

Are you copying all tables? I would use BACKUP/RESTORE

Allan


"ND Developer" <ND Developer (AT) discussions (DOT) microsoft.com> wrote in message
news:AD472699-FC05-4789-8B5C-7B8BCB984B12 (AT) microsoft (DOT) com:

We've just performed a DTS copy objects and data from the production
server
to the development server, but the DTS failed on updating the
referential
integrity.

The following error is reported with the specific names of the database,
fk,
table, and column replaced with generics in brackets:

Step Error Source: Microsoft SQL-DMO (ODBC SQLState: 23000)
Step Error Description:[Microsoft][ODBC SQL Server Driver][SQL
Server]ALTER
TABLE statement conflicted with COLUMN FOREIGN KEY constraint
'FK_[foreign
key]'. The conflict occurred in database '[database]', table '[Table]',
column '[Column]'.
Step Error code: 80040223
Step Error Help File:SQLDMO80.hlp
Step Error Help Context ID:1131



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.