Saturday, June 1, 2019

Sitecore XC 9.2- Fix for Install- MERGE statement attempted to UPDATE or DELETE



Today, I was trying to install XC again to refresh an existing instance and found below error -

msdeploy.exe : Error: .Net SqlClient Data Provider: Msg 8672, Level 16, State 1, Line 2 The MERGE statement attempted to UPDATE or DELETE the same row more than once. This happens when a target row matches more than one source row. A
MERGE statement cannot UPDATE/DELETE the same row of the target table multiple times. Refine the ON clause to ensure a target row matches at most one source row, or use the GROUP BY clause to group the source rows.
At C:\Program Files\WindowsPowerShell\Modules\SitecoreInstallFramework\2.1.0\Public\Tasks\Invoke-CommandTask.ps1:31 char:13
+             & $Path $Arguments | Out-Default
+             ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Error: .Net Sql...he source rows.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Error: Script execution error.  The executed script:
BEGIN TRANSACTION;
CREATE TABLE #Blobs (
    BlobId  UNIQUEIDENTIFIER NOT NULL,
    [Index] INT              NOT NULL,
    Data    IMAGE            NOT NULL,
    Created DATETIME         NOT NULL
);
CREATE TABLE #Items (
    ID         UNIQUEIDENTIFIER NOT NULL PRIMARY KEY,
    Name       NVARCHAR (256)   COLLATE database_default NOT NULL,
    TemplateID UNIQUEIDENTIFIER NOT NULL,
    MasterID   UNIQUEIDENTIFIER NOT NULL,
    ParentID   UNIQUEIDENTIFIER NOT NULL,
    Created    DATETIME         NOT NULL,
    Updated    DATETIME         NOT NULL

Fix - you must remove the reference to the "ModuleHabitatImages" from the Includes section of the Master_SingleServer.json file

No comments:

Post a Comment