Delete Unreferenced Rows

Before you begin

Filter CloneDB.

About this task

CloneDB contains common resource tables (that is, child tables), such as Comments and ESignatures, which are referenced by multiple tables (parent tables). When you delete such parent tables while filtering the database, the rows of the child tables may be left without reference to any parent table. You can use the RemoveUnreferencedRows utility to generate a script that deletes the unreferenced rows from the child tables. For information on the commands used to run the utility, refer to RemoveUnreferencedRows Utility.

Procedure

  1. Download the latest version of the RemoveUnreferencedRows.exe and ReferencedTables.xml files from the KB article number 000036043.
    Tip:
    You can search for the KB article here: https://digitalsupport.ge.com/.
  2. Access SQL Server Management Studio (SSMS).
  3. Create an SQL script using the RemoveUnreferencedRows.exe file.
    Note:
    For more information, refer to the SSMS documentation.
    The following example uses Windows authentication to log in to SqlServerInstanceName:
    D:\Utilities\bin>RemoveUnreferencedRows.exe -d SqlServerInstanceName -t CloneDB -f ReferencedTables.xml > <SQLScriptName>.sql
    Note:
    You can also use SQL authentication using -UserName and -Password.
  4. Run the script.
    The unreferenced rows are deleted from the child tables in CloneDB.
    Note:
    The time taken by the script to run depends on the size of CloneDB.

What to do next

Disable triggers.