Skip to main content
Kofax

Fatal database error Cannot delete or change record Since related records exist in table when publishing Batch Class

11727

QAID # 11727 Published 

Question / Problem:

I receive the folllowing error when publishing Batch Classes:

"Fatal database error - Can't delete or change record. Since related records exist in table The DELETE statement conflicted with the REFERENCE constraint "BatchDocumentPart4"".

How can I resolve this issue?

Answer / Solution:

This error is caused by the orphaned records in the Batch Document tables, as stated in QAID 7947. The error message may vary depending on the version of the Kofax Capture / Ascent Capture, but it should be similar to the one in this article.

If the database has been migrated to full SQL Server, then the workaround to resolve the problem is to run the following SQL query directly on the Kofax Capture / Ascent Capture database:

To find out how many rows are impacted, run the following:

SELECT COUNT(*) NOLOCK FROM BatchDocumentPartialRel
WHERE BatchID NOT IN (SELECT ExternalBatchID FROM BatchCatalog)

Then,

DELETE FROM BatchDocumentPartialRel
WHERE BatchID NOT IN (SELECT ExternalBatchID FROM BatchCatalog)

Note: It is strongly recommended to back up the database prior to running the SQL query.

Applies to:

Product Version Category
CAPTURE 7.0 Administration
CAPTURE 7.0 Database
CAPTURE 7.5 Administration
CAPTURE 7.5 Database
CAPTURE 8.0 Administration
CAPTURE 8.0 Database
CAPTURE 9.0 Administration
CAPTURE 9.0 Database