3

In SQL Server 2016, I want to move ALL Clustered indexes in a DB to a secondary filegroup. What's the easiest way to do this?

This question is only for Nonclustered Indexes.

Moving all non-clustered indexes to another filegroup in SQL Server

Note: Want to retain Nonclustered indexes in same filegroup, and prevent creating additional unique indexes on primary key

In the process of optimizing an older legacy database

  • Why not generating the drop/create script for all indexes and alter the script and drop/create all indexes? – FLICKER May 22 '19 at 21:56
  • Try this solution: [moving-large-number-of-tables](https://dba.stackexchange.com/questions/16708/moving-large-number-of-tables-to-different-filegroups) – Piotr Palka May 22 '19 at 23:00
  • 1
    If you move a tables clustered index to a different filegroup. It just moves the table. https://learn.microsoft.com/en-us/sql/relational-databases/indexes/move-an-existing-index-to-a-different-filegroup?view=sql-server-2017#BeforeYouBegin. – Nick.Mc May 22 '19 at 23:03

0 Answers0