• Hi,

    Take a look at the following article[/url], it contains a reference to one of the best index rebuild scripts there is. When the stored procedure encounters a partitioned index, it performs a specific action.

    Index Optimisation Script Link

    [/url]

    See procedure snippet below that identifies the partitioned indexes.

    /* Determine if the index is partitioned */

    SELECT @partitionSQL = 'Select @partitionCount_OUT = Count(*)

    From ' + @databaseName + '.sys.partitions

    Where object_id = ' + CAST(@objectID AS VARCHAR(10)) + '

    And index_id = ' + CAST(@indexID AS VARCHAR(10)) + ';'

    , @partitionSQL_Param = '@partitionCount_OUT int OutPut';

    I'm certain you could easily modify the stored procedure and/or code to suit your needs.

    Cheers,