Drop Foreign Keys

Search Knowledge Base by Keyword

< Back

The DROPFKEYS Action removes Foreign Key Constraints from the Staging Database. It removes all Foreign Key Constraints where:

  1. The Foreign Key is set to “Active” in the ForeignKeys sheet.
  2. The relevant Foreign Key table and Primary key table is set to “Active” in the Tables Sheet.

To run DROPFKEYS, first open your re-usable .cmd script in a text editor.

If you have already configured a .cmd script for one Subset Action and wish to edit and re-use that script, you should only need to specify “DROPFKEYS” for  -parAction=””:

Data Subsetting

Otherwise, configure all mandatory parameters in the .cmd script.

You can also specify optional parameters for the Action.

Make sure your Control Spreadsheet, the Subset Report, and any Log Files are closed.

Run the script to remove the Foreign Keys from your Staging Database.

Check the Log File and Subset Report at this stage, to check that the Actions have performed correctly.

Next, check your Database to make sure the Foreign Keys constraints have been removed. You can then update your Control Spreadsheet and Add Foreign Keys if you want.