SQL Express compress MDF file

Posted on 2009-04-15
Last Modified: 2012-06-21
Ive been doing a lot of work in aspx on a mdf file, and now its empty, but showing as 6Gb in size.

Is there a command I can issue to compact the database, or is it a case of deleting it and starting again with an empty mdf file?

Any help would be appriciated.

Thank you
Question by:tonelm54
    1 Comment

    Accepted Solution

    Just for future users wanting to know, I found this to work really well as a command

    DBCC SHRINKDATABASE ("C:\Documents and Settings\App_Data\Database.mdf")

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now