Step 5 – Disk space recovery on database server
If not having used filegroups at folder creation or import time
In this case, everything that you have deleted from the folder was stored in the SQL database primary data file.
All space that was used by the folder’s objects is now free but the datafile has not been reduced.
This free space can be used by other folder tables or indexes if other folders don’t use filegroups.
If you want to recover disk space, reduce your SQL database primary datafile using the appropriate procedure.
Consult the SQL Server documentation to get the best method for your version and use case. For example DBCC SHRINK with the proper arguments, or directly within SQL Server Management Studio by reducing datafile sizes in the database properties.
If having used filegroups at folder creation or import time
If you have ticked the proper check box at folder creation or import time, you have used dedicated filegroups for storing folder objects.
If the Step 4 – SQL Server database cleanup procedure ended successfully, you can now recover disk space by removing the filegroups that were associated with the folder. This deletes the associated datafiles in succession.
- Right-click on your SQL database in SQL Server Management Studio and click Properties.
- When the pop-up window opens, go to the Filegroups page.
- For each deleted FOLDERNAME folder, select the FOLDERNAME_DAT filegroup and click Remove.
- Then select the FOLDERNAME_IDX filegroup and click Remove.
- When all relevant filegroups have been removed from this window, click OK to proceed to the actual removal.
If you click Cancel nothing is removed.
- After this is done, if you check the database properties again in the Filegroups page, you can see that they are no longer there.
- If you look at the Files page, there is no more associated datafile.