Solved

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

Posted on 2004-10-22
151 Views
Last Modified: 2013-12-24
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!
0
Question by:ktjamms2
    5 Comments
     
    LVL 22

    Expert Comment

    by:pinaldave
    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
     
    LVL 22

    Expert Comment

    by:pinaldave
    Hi ktjamms2,

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

    Regards,
    ---Pinal
    0
     

    Author Comment

    by:ktjamms2
    The relationship ties the customer to the item they purchased and therefore necessary. The field is not in both tables
    0
     
    LVL 9

    Accepted Solution

    by:
    UPDATE CustTable
    SET No = NULL

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

    Author Comment

    by:ktjamms2
    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone. Privacy Policy Terms of Use

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
    Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
    In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…
    Want to pick and choose which updates you receive? Feel free to check out this quick video on how to manage your email notifications.

    875 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now