• Here are my patches:

  • If there are multiple covering indices on the same table column, then multiple runs of spFixIndexNaming will spuriously flip back and forth between the two.
  • Uniquifier = ROW_NUMBER() OVER (PARTITION BY NewName ORDER BY SchemaName, OldName, NewName)

    Note I added OldName, in order to prevent spurious flipping back and forth.

    Test parameter:

    @IndexConvention = 'IX_%INDEX_TYPE%_%UNIQUE_INDEX%%FILTERED_INDEX%_%TABLE_NAME%_%INDEX_COLUMNS%'

  • Ignore any IsMsShipped tables: OBJECTPROPERTY(object_id, 'IsMSShipped') = 1
  • FROM

    sys.indexes i

    JOIN sys.tables t ON

    i.object_id = t.object_id AND

    i.type_desc IN ('CLUSTERED', 'NONCLUSTERED', 'XML', 'SPATIAL')

    AND t.is_ms_shipped = 0

    Note I added AND t.is_ms_shipped = 0 to exclude IsMsShipped objects.