How can i create a database if my drive is compressed ? RRS feed

  • Question

  • User1253338400 posted

    I have set the following under my SQL data directory

    1. Right click the 'DATA' folder (i.e. the folder that contains .mdf files)
    2. Choose 'Properties'
    3. Click the 'Advanced' button
    4. Uncheck the 'Compress contents to save disk space' checkbox
    5. Click 'Ok

    When i try to create a database in my c# app , i get the following error

    Error message "The file "MyDatabase.mdf" is compressed but does not reside in a read-only database or filegroup. The file must be decompressed."

    My create database command in my c# app is as follows:

           use master IF DB_ID(N'MyDatabase') IS NULL CREATE DATABASE MyDatabase ");

    How can i create a db on a compressed drive ?


    Monday, October 5, 2020 11:36 AM