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

后端 未结 5 1957
眼角桃花
眼角桃花 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 18:07

    It's because you have records in the table already that are not unique (by the sounds of it, 2 records with a blank value in the TopicShortName field).

    So, it's to do with the data, not the index itself.

提交回复
热议问题