-
Notifications
You must be signed in to change notification settings - Fork 748
Why doesn´t you permit to execute the rebuild on online mode on SQL Azure? #238
Description
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, ';