I'm trying to create an index on table [Children] in SQL Azure but get the following error:
The operation failed because an index or statistics with name 'IX_Children_ParentID' already exists on table 'Children'.
As far as I can see there's no index or statistics with this name. The following command returned zero results so there shouldn't be any indexes or statistics. Is that correct?
SELECT object_id, name FROM sys.stats WHERE name = 'IX_Children_ParentID'
UNION ALL
SELECT object_id, name FROM sys.indexes WHERE name = 'IX_Children_ParentID'
UPDATE: Changed the query in response to @Shark's anwer.
My SQL command for creating the index:
CREATE INDEX IX_Children_ParentID
ON [myschema].[Children]
(
[ParentID] DESC
)
Before this error occurred I had problems with timeouts while creating the index. Could this be caused by some remnants?