Unable to create index because of duplicate that doesn't exist?

后端 未结 5 1958
眼角桃花
眼角桃花 2021-02-03 17:19

I\'m getting an error running the following Transact-SQL command:

CREATE UNIQUE NONCLUSTERED INDEX IX_TopicShortName
ON DimMeasureTopic(TopicShortName)
         


        
5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-03 17:59

    The duplicate is in your data, try running this query to find it.

    SELECT TopicShortName, COUNT(*)
    FROM DimMeasureTopic
    GROUP BY TopicShortName
    HAVING COUNT(*) > 1
    

提交回复
热议问题