Automatically Drop and Recreate current indexes

后端 未结 2 1895
陌清茗
陌清茗 2021-01-18 18:02

I\'m working on providing a method to allow for bulk updating our tables ( greater than 1M new or updated rows per update) and was interested in dropping the current indexes

2条回答
  •  不思量自难忘°
    2021-01-18 18:27

    EXEC sp_MSforEachTable 'ALTER INDEX ALL ON ? DISABLE'
    

    and

    EXEC sp_MSforEachTable 'ALTER INDEX ALL ON ? REBUILD'
    

    is all you need if you want to do it for all tables and every index.

提交回复
热议问题