Skip to content

Why doesn´t you permit to execute the rebuild on online mode on SQL Azure? #238

@japineda3

Description

@japineda3

Hi,
Why doesn´t you include the version of SQL Azure in this check?

### /* Refer to http://docs.microsoft.com/sql/t-sql/functions/serverproperty-transact-sql */ IF (SELECT SERVERPROPERTY('EditionID')) IN (1804890536, 1872460670, 610778273, -2117995310) SET @editionCheck = 1 -- supports enterprise only features: online rebuilds, partitioned indexes and MaxDOP ELSE SET @editionCheck = 0; -- does not support enterprise only features: online rebuilds, partitioned indexes and MaxDOP

 The version of SQL Azure is 1674378470. You can execute online rebuild on SQL Azure. 

 Then, when you execute the adaptativeindexdefrag which @onlineRebuild = 1 , as in the code you checks is:

_Indexes will be defragmented' + CASE WHEN @onlineRebuild = 0 OR @editionCheck = 0 THEN ' OFFLINE;' ELSE ' ONLINE;' END + ' /* Set online rebuild options; requires Enterprise Edition; not compatible with partition operations, Columnstore indexes in table and XML or Spatial indexes. Up to SQL Server 2008R2, not compatible with clustered indexes with LOB columns in table or non-clustered indexes with LOBs in INCLUDED columns. In SQL Server 2012, not compatible with clustered indexes with LOB columns in table.*/ IF @sqlmajorver <= 11 AND @onlineRebuild = 1 AND @editionCheck = 1 AND @ixtype IN (1,2) AND @containsLOB = 0 AND (@dealMaxPartition IS NULL OR (@dealMaxPartition IS NOT NULL AND @partitionCount = 1)) SET @rebuildcommand = @rebuildcommand + N'ONLINE = ON, ';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions