Views:

Note: The installer ISO image on the website was updated with a new update script that should prevent this issue.

Problem

Some customers while updating to MET/TEAM version 3.2.0 receive an error in the installation log file indicating that the SQL update script failed to run.

When running the script manually in SQL Server Management Studio, an error message like this one occurs:

Adding Context Element for ProcedureFile

Msg 547, Level 16, State 0, Line 692

The INSERT statement conflicted with the FOREIGN KEY constraint "fk_ContextElements_UCIData_nUCIDataUID". The conflict occurred in database "metteam", table "dbo.UCIData", column 'nUCIDataUID'.

Solution

First, verify the missing record by running the following query:

SELECT * FROM UCIData WHERE nUCIDataUID = 'f1bd5d98-5b25-47de-a7e6-52bed7df377d'

Once confirming that the record is missing, run this script to add the missing record:

INSERT INTO [dbo].[UCIData] ([nUCIDataUID], [cModel], [cField], [cProperty], [cValue], [lActive], [lDeleted], [lApproved], [lAdded], [nAddFacilityUID], [nAddUserUID], [tAddTime], [nUpdateFacilityUID], [nUpdateUserUID], [tUpdateTime], [tMobileTime], [tSystemUpdateTime], [nImportUID]) VALUES ('f1bd5d98-5b25-47de-a7e6-52bed7df377d', N'Procedures', N'nProcedureFileUID', N'Label', N'Procedure File', -1, 0, 0, -1, 'f7e2e0c9-cef7-4c92-900f-ba1d5f7b1c29', '915f9722-3175-4e4d-a571-4a478e8e5172', '2017-01-20 18:44:06.667', 'f7e2e0c9-cef7-4c92-900f-ba1d5f7b1c29', '915f9722-3175-4e4d-a571-4a478e8e5172', '2017-01-20 18:44:06.690', '2017-01-20 18:44:06.690', NULL, NULL)

Then re-run the update script.