Q&A: A user of our software reported a SQL Server Error. The software had been running fine previously. The error is:
The file at C:\Program Files\Microsoft SQL Server\MSSQL14.SQLEXPRESS\MSSQL\DATA{database}.mdf is compressed but does not reside in a read-only database or filegroup. The file must be decompressed. CREATE DATABASE failed. Some file names listed could not be created. Check related errors.
What's the fix please?
Posting as a Q&A as I couldn't find a step-by step answer on StackOverflow and Windows is now recommending file compression when your disk is nearly full.
The filegroup contains the primary data file and any secondary files that aren't put into other filegroups. User-defined filegroups can be created to group data files together for administrative, data allocation, and placement purposes.
Database compression is a set of techniques that reorganizes database content to save on physical storage space and improve performance speeds. Compression can be achieved in two primary ways: Lossless: Original data can be fully reconstructed from the compressed data.
A FILESTREAM filegroup is a special filegroup that contains file system directories instead of the files themselves. These file system directories are called data containers. Data containers are the interface between Database Engine storage and file system storage.
The SQL Server data compression reduces the amount of physical disk space required to store data and the amount of disk I/O is saved by performing SQL Server data compression.
As stated here, SQL Server databases are not supported on compressed volumes.
In this case, Windows had recommended compression to make more room on their hard drive, so they did just that.
The fix was:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With