Disable all non-clustered indexes

后端 未结 5 2009
星月不相逢
星月不相逢 2020-12-29 05:36

I select a number of non-clustered indexes from my database with the following:

SELECT  sys.objects.name tableName,
        sys.indexes.name indexName
FROM           


        
5条回答
  •  失恋的感觉
    2020-12-29 06:26

    OTOH it might be better to DROP rather that DISABLE (or is it a petty lil syntactic diff between Oracle and MS SQL? :-) The reason I mention is that I remember tables that were repopulated and excplicilty denormalized twice a day and we were DROP-ing all indexes in order to force DB to rebuild both indexes and sproc execution plans after we loaded new date and rebuild all indexes.

    Of course we had separate script for that since once you drop them, indexes are not in system tables anymore.

提交回复
热议问题