Link to home
Start Free TrialLog in
Avatar of ktjamms2
ktjamms2Flag for United States of America

asked on

Delete one field's data from a table with a relationship

I want to delete the credit card number from the database kept on the server for security purposes. I used a cfquery
<CFQUERY NAME="DeleteCrNo" datasource="database">
DELETE No FROM CustTable  
</CFQUERY>

but the table is related to another table and I get an error cannot be deleted or changed because table 'sales' includes related records.

Can someone tell me how to delete the data from this field?
Thanks!
Avatar of pinaldave
pinaldave
Flag of India image

Hi ktjamms2,
1) you need to drop the relations.
If you are deleting them then the relations anyway does not mean to you as you are loosing the information. So you need to remove the realtions.

2) then you can delete them.

Regards,
---Pinal
Hi ktjamms2,

if there is some constrain then you need to remove that constrain also...

Regards,
---Pinal
Avatar of ktjamms2

ASKER

The relationship ties the customer to the item they purchased and therefore necessary. The field is not in both tables
ASKER CERTIFIED SOLUTION
Avatar of shooksm
shooksm

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I need the info from the column. I want to keep the database backed up on some other media and keep the info from being stored in the database on the server.