How to remove secondary file group We have a SQL Server database with two filegroups; PRIMARY and SECONDARY, with a single file in each file group. 

All the clustered indexes are stored in the secondary filegroup. How can we remove the SECONDARY filegroup?
The clustered index structure is the table in SQL Server.
In order to remove a filegroup, you first need to remove all data from the filegroup.  There are several ways of doing that, including using the GUI, like this:

Right-click the table, and choose &quot;Design&quot;
Right-click the &quot;empty&quot; area of the top design panel, and choose &quot;Properties&quot; like this:



In the &quot;Properties&quot; pane (typically shown to the right of the &quot;Design&quot; pane), you open the &quot;Regular Data Space Specification&quot; and change the name of the &quot;Filegroup or Partition Scheme Name&quot; to the name of the target filegroup:


Be aware, this method will result in SSMS generating code that actually drops-and-recreates the table.
An alternate method of doing that would be to rebuild the indexes for the table, specifying the target filegroup in the rebuild command.  I've written a blog-post showing the code I use to accomplish that over at SQLServerScience.com