sql server 2005 - Unable to create index because of duplicate that doesn't exist? -
I'm having an error running the following Transact-SQL command:
Create unique error : Make message 1505, Level 16, State 1, Line 1 end unique index statement because a duplicate key was found for the object name 'dbo.DimMeasureTopic' and the index name 'IX_TopicShortName'. Duplicate key value () is.
When I run SELECT * FROM sys.indexes, name = 'IX_TopicShortName'
or SELECT * FROM from SYS. Indexed WHERE object_id = OBJECT_ID (N '[dbo]. [DimMeasureTopic]')
The IX_TopicShortName index is not displayed so there is no duplicate.
I have the same schema in another database and can create index without problems. Why not make any ideas here?
It is not that the index already exists, but in the table there TopicShortName
Duplicate values in the field are duplicate value as an error message is an empty string (this may be one aspect of posting I probably do). Such a duplicate prevents a UNIQUE
index from halting.
You can run a query to confirm that you have a duplicate:
SELECT TopicShortName, COUNT (*) from DimMeasureTopic GROUP by TopicShortName Hosting COUNT (* ) & Gt; 1
The data is different in other databases, and duplicates are not present.
Comments
Post a Comment