Creating Database When MDF is Compressed

In this article, we learn how to create a database when the error “The file MDF is compressed but does not reside in a read-only database or filegroup. The file must be decompressed” occurs.

I was trying to create a database using two methods. The first is by using a command and the second is by using a wizard. When I tried to create a database I got the following error.

Using command:

create database PramodTest

1

Using the wizard:

3

2

Note: Please change the respective path depending on your SQL Server datafile.

Go to the following path: C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL

4

Right-click on the DATA folder and select properties.

5

You will find another dialog box.

6

Click on the Advanced button and you will get the following screen.

7

 

 

Uncheck “Compress contents to save disk space” and click on OK.

After making those changes I ran the following code and it ran successfully.

8

I hope this article is helpful for you.

Thanks 🙂

Tags: , , ,