Cannot release unused space in SQL Server mdf file I have a huge mdf file (61 GB) and it is 95% empty
I want to release unused space.
I tried to Shrink the file
but when I click OK the Shrink screen closes and nothing happens
the file still 61 GB
How to resolve this?
Relase unused space frees only the space after the last allocated extend in the data file. Since 95% of the space in the data file is not in use you need to perform file reorganization. You can do it from SSMS by choosing Reorganize pages before releasing unused space and setting the suggested Shrink file size to 2490 MB or higher value.
As an alternative you can execute command (I recommend to do it this way):
DBCC SHIRINKFILE ( Res )