Self-Solve Knowledge Search

Minimize Maximize
SQL Command failed while upgrading the project from ALM 11.52 to ALM 12.21
This document has not been formally reviewed for accuracy and is provided as is
Title :
SQL Command failed while upgrading the project from ALM 11.52 to ALM 12.21
Document ID :
KM02023754
Product - Version:
quality center ;
OS :
Updated :
Mon Dec 14 05:22:25 GMT 2015
Summary :
SQL Command failed while upgrading the project from ALM 11.52 to ALM 12.21
Problem

SQL Command failed while upgrading the project from ALM 11.52 to ALM 12.21

The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'td.LISTS' and the index name ... 'LS_LOGICAL_NAME_IDX'. The duplicate key value is (hp.qc.plan-status.imported).
Failed SQL: /* ~~QC */CREATE UNIQUE NONCLUSTERED INDEX [LS_LOGICAL_NAME_IDX] ON [LISTS]([LS_LOGICAL_NAME])

image text

Cause
It's not that the index already exists, but that there are duplicate values in the LS_LOGICAL_NAME field in the table itself which needs to be checked and changed
Fix

Run the below query to find the fields which have same value for column LS_LOGICAL_NAME and make changes so that all LS_LOGICAL_NAME columns are unique.

SELECT
    LS_LOGICAL_NAME,
    COUNT(*)
FROM
    LISTS
GROUP BY
    LS_LOGICAL_NAME
HAVING
    COUNT(*) > 1

Once that is done, continue the upgrade process.