Remove all data

  • Hi all,

     I have this problem, I have to scub all data out of my database relating to any contract number(Primary Key).

    There are about 7000 contracts in the database as well as other information that I cannot loose. The only info I need to get rid of is the contracts.

    Thanks for the help

  • I hope this answer is not too simplistic. A few questions first:

    • How many tables currently house entries related to the contract(s) in question?
    • Also, how are the foreign keys set up-to cascade on delete?

    If the answer to question 2 is that the keys are designed to cascade on delete, then you can delete them for the main "contracts" table and the database will take care of the rest. If, however, the keys are set up for NO ACTION then you'll have to delete the entries in all foreign key tables first, then delete from the table where the contract ID is the primary key.

  • Thaks for your answer Tim,

      There are more than 20 Tables and  all foreignkeys are setup for "NO ACTION".... ouch

    We are taking the long road to delete all the foreign key tables first.

    Thanks

     

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply