Friday, February 24, 2012

Error in creating or attaching database

I was getting following error while creating a database or attaching a database to sql server 2005

"The file <<*.mdf>> is compressed but does not reside in a read-only database or filegroup.."

In this scenario, if you try sp_attach_db procedure, you get following error:
Msg 5118, Level 16, State 1, Line 1

After

little bit of troubleshooting, I found this was happening because of a

folder option (of the folder where database file reside (in case of

attach) or being created (in case of create)).

Go to folder

properties, General Tab, click on Advanced button,check "Compress or

Encrypt attributes" section. If the first option (Compress contents to

save disk space) is checked, you get that error. Uncheck it to fix that

problem.

Hi,

i would suggest you to refer

http://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=649468&SiteID=17

https://forums.microsoft.com/TechNet/ShowPost.aspx?PostID=12337&SiteID=17

HTH

Hemantgiri S. Goswami

No comments:

Post a Comment