Translate

Thursday, June 23, 2016

Disable Column Store Indexes for One Database

Disabling column store indexes needs to be done time to time. Following query will generate the script. 

SELECT 'ALTER INDEX [' + Name + +'] ON ' + OBJECT_NAME(object_id) + ' DISABLE'
FROM sys.indexes WHERE TYPE_DESC
LIKE '%COLUMNSTORE%'

Output of the query is shown below.

ALTER INDEX [IndFactResellerSalesXL_CCI] ON FactResellerSalesXL_CCI DISABLE
ALTER INDEX [NonClusteredColumnStoreIndex-20160622-204327] ON DimEmployee DISABLE
ALTER INDEX [NonClusteredColumnStoreIndex-20160622-210321] ON FactInternetSales DISABLE

No comments:

Post a Comment