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!
ktjamms2Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pinaldaveCommented:
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
0
pinaldaveCommented:
Hi ktjamms2,

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

Regards,
---Pinal
0
ktjamms2Author Commented:
The relationship ties the customer to the item they purchased and therefore necessary. The field is not in both tables
0
shooksmCommented:
UPDATE CustTable
SET No = NULL

Or if you no longer want the No column, alter the table and remove it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ktjamms2Author Commented:
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.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.