The ALTER TABLE statement conflicted with the CHECK constraint CK_MKTSEGMENTATIONSEGMENT_ISHISTORICAL" when running revisions after upgrading to version 3.0"

  When upgrading from version 2.9 to 3.0, and running the Service Revisions task, users may receive the error:


The "RunServiceRevisions" task failed unexpectedly.
Blackbaud.AppFx.Platform.BuildTasks.RunServiceRevisionsHelpers.RevisionExecutionException: An error occurred while executing a service revision.
Revision text: LoadSpec: 5235.SegmentationSegment.Table.xml Blackbaud.AppFx.Galileo.ServiceRevisions.Specs1340.zip ---> Blackbaud.AppFx.Platform.BuildTasks.RunServiceRevisionsHelpers.LoadSpecException: Procedure Return Code: 0 ---> System.Exception: The ALTER TABLE statement conflicted with the CHECK constraint "CK_MKTSEGMENTATIONSEGMENT_ISHISTORICAL". The conflict occurred in database "VBN3APRIL14", table "dbo.MKTSEGMENTATIONSEGMENT". ---> System.Data.SqlClient.SqlException: A .NET Framework error occurred during execution of user defined routine or aggregate 'USP_LOADSPEC_AS_STRING': 
System.Data.SqlClient.SqlException: The ALTER TABLE statement conflicted with the CHECK constraint "CK_MKTSEGMENTATIONSEGMENT_ISHISTORICAL". The conflict occurred in database "VBN3APRIL14", table "dbo.MKTSEGMENTATIONSEGMENT".
System.Data.SqlClient.SqlException: 
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQuerySmi(Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at Blackbaud.AppFx.Platform.SqlClr.TableSpecProcessor.ExecuteSQLNonQuery(String sql)
   at Blackbaud.AppFx.Platform.SqlClr.TableSpecProcessor.VerifyExistingConstraints(TableSpec spec)
   at Blackbaud.AppFx.Platform.SqlClr.TableSpecProcessor.VerifyTable(TableSpec spec)
   at Blackbaud.AppFx.Platform.SqlClr.TableSpecProcessor.CreateOrUpdateTable(TableSpec spec, String primaryKeyDataTypeName)
   at Blackbaud.AppFx.Platform.SqlClr.TableSpecProcessor.ProcessSpec(TableSpec spec, Nullable`1 changeAgentID, String primaryKeyDataTypeName)
   at Blackbaud.AppFx.Platform.SqlClr.TableSpecProcessor.ProcessSpec(String specXml, Nullable`1 changeAgentID)
   at Blackbaud.AppFx.Platform.SqlClr.TableSpecClr.ProcessSpec(String specXml, Nullable`1 changeAgentID, SqlBoolean skipValidation, SqlBoolean compareToExistingSpecXml)
   at Blackbaud.AppFx.Platform.SqlClr.LoadSpec.LoadSpecInternal(String specTypeName, String specXmlText, SqlString itemName, Nullable`1 changeAgentId, SqlBoolean processPageAlterations, SqlBoolean skipValidation, SqlBoolean compareToExistingSpecXml)
   at Blackbaud.AppFx.Platform.SqlClr.LoadSpec.LoadSpecAsString(String specXmlText, Nullable`1 changeAgentID, SqlString sourceName, SqlString itemName, SqlBoolean loadAsDependency, SqlBoolean forceReload, SqlBoolean processP...
LOADSPEC ERROR:The ALTER TABLE statement conflicted with the CHECK constraint "CK_MKTSEGMENTATIONSEGMENT_ISHISTORICAL". The conflict occurred in database "VBN3APRIL14", table "dbo.MKTSEGMENTATIONSEGMENT".
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
   at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()


  We are currently evaluating this issue and will update this article when we have more information.

Environment

 3.0.516

Was this article helpful?