Hey,
I got a table in which i want to delete a few rows. The
table has a primary key and withing the coloums it has
an "instanceid" which is pointed to another table
called "instance" and that table has many pk and fk. When
i try to delete a row from the 1 table mentioned, i get
the error:
Delete statement conflicted with COLUMN REFERENCE
constraint XXXX. The conflict occured in database yyyy,
table 1111, column 3333. The statement has been terminated.
Any ideas for a work arround?Essentially you are try to delete a parent record that has child records.
The FK is preventing you as it would cause orpahns.
You will need to delete all the child records before deleting the parent.
--
HTH
Ryan Waight, MCDBA, MCSE
"nefasha" <anonymous@.discussions.microsoft.com> wrote in message
news:081101c3a78e$7e9b2fc0$a601280a@.phx.gbl...
> Hey,
> I got a table in which i want to delete a few rows. The
> table has a primary key and withing the coloums it has
> an "instanceid" which is pointed to another table
> called "instance" and that table has many pk and fk. When
> i try to delete a row from the 1 table mentioned, i get
> the error:
> Delete statement conflicted with COLUMN REFERENCE
> constraint XXXX. The conflict occured in database yyyy,
> table 1111, column 3333. The statement has been terminated.
> Any ideas for a work arround?|||But it isnt a parent id!!! The table X has a column
instanceid which points to a table y where THAT table has
PK and FK with OTHER tables using the instance id... i
dont see why that affects table X?
>--Original Message--
>Essentially you are try to delete a parent record that
has child records.
>The FK is preventing you as it would cause orpahns.
>You will need to delete all the child records before
deleting the parent.
>--
>HTH
>Ryan Waight, MCDBA, MCSE
>"nefasha" <anonymous@.discussions.microsoft.com> wrote in
message
>news:081101c3a78e$7e9b2fc0$a601280a@.phx.gbl...
>> Hey,
>> I got a table in which i want to delete a few rows. The
>> table has a primary key and withing the coloums it has
>> an "instanceid" which is pointed to another table
>> called "instance" and that table has many pk and fk.
When
>> i try to delete a row from the 1 table mentioned, i get
>> the error:
>> Delete statement conflicted with COLUMN REFERENCE
>> constraint XXXX. The conflict occured in database yyyy,
>> table 1111, column 3333. The statement has been
terminated.
>> Any ideas for a work arround?
>
>.
>|||Nevermind!!!1 I figured what i was doing wrong!!! thanxs
for the help anyways!
>--Original Message--
>But it isnt a parent id!!! The table X has a column
>instanceid which points to a table y where THAT table has
>PK and FK with OTHER tables using the instance id... i
>dont see why that affects table X?
>>--Original Message--
>>Essentially you are try to delete a parent record that
>has child records.
>>The FK is preventing you as it would cause orpahns.
>>You will need to delete all the child records before
>deleting the parent.
>>--
>>HTH
>>Ryan Waight, MCDBA, MCSE
>>"nefasha" <anonymous@.discussions.microsoft.com> wrote in
>message
>>news:081101c3a78e$7e9b2fc0$a601280a@.phx.gbl...
>> Hey,
>> I got a table in which i want to delete a few rows. The
>> table has a primary key and withing the coloums it has
>> an "instanceid" which is pointed to another table
>> called "instance" and that table has many pk and fk.
>When
>> i try to delete a row from the 1 table mentioned, i get
>> the error:
>> Delete statement conflicted with COLUMN REFERENCE
>> constraint XXXX. The conflict occured in database yyyy,
>> table 1111, column 3333. The statement has been
>terminated.
>> Any ideas for a work arround?
>>
>>.
>.
>
No comments:
Post a Comment