NOTE: This article is listed in the following 'checklist' guides: [DSP] Application Installation Errors
Versions: All DSP/DSMA/ISA versions
Issue:
Error thrown by installation PowerShell script:
“Encountered disabled or untrusted constraint ‘FK_ztSystemTypeDataDictionaryTable_ztSystemType’ on table ‘ztSystemTypeTable’”
Resolution:
Execute the following query in SQL Server Management Studio:
SELECT * FROM [DSPCommon].[dbo].[ztSystemTypeTable]
WHERE SystemTypeID NOT IN
(SELECT SystemTypeID FROM ztSystemType)
If any records are returned, these are orphaned system types and will need to be removed before the upgrade can be completed. Follow these steps:
- Note the system type IDs returned by the query above.
- Create copies of the pertinent system type tables using the following syntax:
USE [DSPCommon]
SELECT * INTO ztSystemTypeTable_BackUp FROM ztSystemTypeTable
SELECT * INTO ztSystemTypeGroupTable_BackUp FROM ztSystemTypeGroupTable - Execute the following statements to clean up the two tables:
DELETE FROM ztSystemTypeGroupTable
FROM ztSystemTypeTable INNER JOIN ztSystemTypeGroupTable
ON ztSystemTypeTable.SystemTypeTableID =ztSystemTypeGroupTable.SystemTypeTableID
WHERE (ztSystemTypeTable.SystemTypeID NOT IN
(SELECT SystemTypeID
FROM ztSystemType))
DELETE FROM ztSystemTypeTable
WHERE SystemTypeID = '{system type id(s) returned by first query}'
- Execute the initial query to ensure no rows are returned:
SELECT * FROM [DSPCommon].[dbo].[ztSystemTypeTable]
WHERE SystemTypeID NOT IN
(SELECT SystemTypeID FROM ztSystemType)
- Continue with the upgrade process by opening the CranSoft Package Manager as an administrator and executing: Install-BOASolution.