Symptoms
Error upgrading from 4.6.4 to 4.6.8
Diagnoses
Received a database error when upgrading. Configuration wizard says to call K2 support. Please call me at
Resolution
While investigating the error and looking at the database supplied we found that the constraint names were incorrect in the
K2server].rEnvironmentServices].sSettingValue] DB. Once those constraints were renamed the installation was able to proceed without issue. It was tested twice to make sure once the constraints were fixed the 2nd errors seen were not there and we could not reproduce those errors after a successful install.
1. remove the existing constraints in the hK2server].rEnvironmentServices].sSettingValue] DB either with the SQL commands below or you can manually remove the constraints.
-- Remove the incorrectly named Constraints in the EnvironmentServices.SettingValue table
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVa__Binar__35DCF99B]
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVa__Boole__2C538F61]
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVa__DateT__33F4B129]
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVa__Decim__33008CF0]
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVa__Doubl__320C68B7]
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVa__Int16__2E3BD7D3]
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVa__Int32__2F2FFC0C]
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVa__Int64__30242045]
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVa__Singl__3118447E]
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVa__Strin__2B5F6B28]
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVa__Times__34E8D562]
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVa__Uniqu__2A6B46EF]
ALTER TABLE LEnvironmentServices].sSettingValue] DROP CONSTRAINT NDF__SettingVal__Byte__2D47B39A]
2. add the correctly named constraints to the hK2server].rEnvironmentServices].sSettingValue] DB
-- Add the missing Constraints in the EnvironmentServices.SettingValue table
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_Binary] DEFAULT (NULL) FOR OBinary]
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_Boolean] DEFAULT (NULL) FOR OBoolean]
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_Byte] DEFAULT (NULL) FOR OByte]
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_DateTime] DEFAULT (NULL) FOR ODateTime]
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_Decimal] DEFAULT (NULL) FOR ODecimal]
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_Double] DEFAULT (NULL) FOR ODouble]
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_Int16] DEFAULT (NULL) FOR OInt16]
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_Int32] DEFAULT (NULL) FOR OInt32]
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_Int64] DEFAULT (NULL) FOR OInt64]
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_String] DEFAULT (NULL) FOR OString]
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_Single] DEFAULT (NULL) FOR OSingle]
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_Timespan] DEFAULT (NULL) FOR OTimespan]
ALTER TABLE LEnvironmentServices].sSettingValue] ADD CONSTRAINT NDF_EnvironmentServices_SettingValue_UniqueIdentifier] DEFAULT (NULL) FOR OUniqueIdentifier]
Once the constraints are renamed you can preform the upgrade if any additional errors occur please let us know.