none
SQLExpress database file auto-creation error

    Question

  • Hi,

    I'm not sure this is the right location to post ...
    I got some issues with VS 2005 BETA 2.

    I done full install except for SQL Express and full install of the SQL server disc.
    Now when looking at the starter kits or building app / sites using sql connection i get the following error:

    An error occurred during the execution of the SQL file 'InstallCommon.sql'. The SQL error number is 5118 and the SqlException message is: The file "R:\DATA\VS2005\SAMPLES\PWSSK\APP_DATA\ASPNETDB.MDF.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.


    Do i need the Express version or is there other way to solve this problem.
    First time i installed the VS 2005 BETA 2 i included the express edition but din't wanna run after i installed the SQL server disc.

    p.s.: I get the same error when trying to manually attach the database to the sql server.

    Greetz
    Deborggraeve Randy
    Monday, May 23, 2005 12:37 PM

Answers

  • On the surface, it looks like the database file is located on a compreesed file system which SQL Server doesn't support.  Only Express can open a connection with User Instance = True in the connection string.  Other SQL Server Editions can attach databases but only if the user has the proper permissions.
    Tuesday, July 05, 2005 10:48 PM

All replies

  • I just bumped onto the same problem.

    What is the proper way to solve this with cassini or IIS?

    My first hunch is to use impersonation in the web.config and run as administrator. This is surely wrong isn't it?
    Friday, May 27, 2005 10:13 PM
  • This has nothing to do with the webserver.

    Seems like only the sql express supports attaching database files.
    Maybe gone install the sql express on a virual machine, attach the file, and import into the sql from the virtual server

    I hope this works

    Sunday, June 26, 2005 1:46 PM
  • On the surface, it looks like the database file is located on a compreesed file system which SQL Server doesn't support.  Only Express can open a connection with User Instance = True in the connection string.  Other SQL Server Editions can attach databases but only if the user has the proper permissions.
    Tuesday, July 05, 2005 10:48 PM
  • If the above answer from Roger hasn't answered your question, please provide more info. Thanks. -Eric

    Thursday, July 07, 2005 8:53 PM
  •  Roger_MS wrote:
    On the surface, it looks like the database file is located on a compreesed file system which SQL Server doesn't support.  Only Express can open a connection with User Instance = True in the connection string.  Other SQL Server Editions can attach databases but only if the user has the proper permissions.


    I allready noticed this ... but im wondering how to get the starters kits working.

    Anyway i fully reinstalled my system few days ago and now have both the sql server and express server running, so it should work now.

    Maybe microsoft should make the databases for starters kits available for download to attach to a normal sql server :)
    If the database could run on the sql server, users only need to change the connection string.
    Sunday, July 10, 2005 10:08 PM
  • Hi,

    Has anyone come across a problem trying to run club web site starter kit and vs 2005 beta 2 and SQL SERVER 2005 ?

    Fails to connect to SQL Server 2005, error is timeout. Web .config connection string says SQLEXPRESS which I changed to SQLSERVER, but still does not work.

    Any suggestions or solutions ?

    KK

    Wednesday, September 21, 2005 10:58 PM
  • The file "d:\sqldata\distribution.mdf" is compressed but does not reside in a read-only database or filegrou.  the file must be decompressed.  Could not open new database distribution. create database is aborted. (Microsoft SQL server Error 5118)

    I have 4 disk.  If I make the disks basic disks instead of dynamic disks with a stripe it works.   Basically SQL 2k5 does not support dynamic disks? Or software Raid 0 ?

    Thursday, April 20, 2006 6:22 PM
  • If you are an SA, go to disk management and unclick "compress disk to save space" for the drive that had the .mdf you are trying to attach.
    Friday, October 27, 2006 4:04 PM
  •  

    Thanks champ! problem solved.

    Monday, May 07, 2007 11:15 PM


  • When trying to attach a database file created in Vista, my WinXP gave the following error:

    "...is compressed but does not reside in a read-only database or filegroup"

    This means that the file is compressed because when it was created (in Vista), the Vista disk is a compressed Disk. But when I transfer it to WinXP, the disk is not a compressed disk.

    Solution:

    On the WinXP (Uncompressed disk),

    1. Right-click on the .mdf file

    2. In the Context Menu that appears, select Properties

    3. In the Properties Dialog that appears, click on the Advanced button

    4. In the Advanced Attributes Dialog that appears, uncheck the Compress Contents To Save Disk Space checkbox. Then click OK. See image

    5. Repeat the same thing for the .ldf file.





    Monday, October 08, 2007 4:40 AM
  • thanks a lot Paul Chin, this solution was very helpful.  i delected my compress files by mistake and that goosed my sql server express, when i tried to lauch the SQL server express, it displayed the following error msg:

     

    The file "g:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf" is compressed but does not reside in a read-only database or filegroup. The file must be decompressed.

     

    I followed your steps above and decompressed the system database files for both the mdf and ldf files and voila, it worked.  Great!!!

    Saturday, April 12, 2008 4:15 PM
  • Hi,

    This problem is due the Database you r going to is already exist ,In this case you have to solve this by right click on App_data folder ,select add existing  item, Then select the DataBase file and click OK. It will ask you Do you want to create
    .mdf file select Ok .Now it will work ..................

    Thanking you
    Saturday, June 28, 2008 11:54 AM
  • my sinceres appreciations and thanks to you my friend ,i did subcribe to this space only to recognize your workful assistance it was very helpful god bless you brother.
    Saturday, May 22, 2010 2:19 PM
  • Dear Deborggraeve Randy,

    check proberty of R:. Make soure Compress Drive to save disk space Chack box is unchecked. if this checked Uncheck it.

    it will be attached.

    Greetings.

    Raghuveer Shekhawat

     

     

     

    Saturday, June 26, 2010 4:21 AM
  • Dear

    check proberty of Disk Drive where you have mdf file. Make soure Compress Drive to save disk space Chack box is unchecked. if this checked Uncheck it.

    it will be attached.

    Greetings.

    Raghuveer Shekhawat

    Saturday, June 26, 2010 4:24 AM
  • Hi,

    I had Same issue in SQL server 2010. Hope this will work on your version also....

    The file "C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\XYZ_MSCRM.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.

    Did Some changes to resolve this Error...!!

    Find the path 

    C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA

    Select "data" Properties>Advance> Uncheck Compress content to disk space Option

    Do SQl services restart once 

    see now Do you have same error again...!!

    Thanks,

    Vinay Kumar.


    Tuesday, December 18, 2012 7:53 AM
  • Thanks!
    Tuesday, December 17, 2013 12:30 PM