Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


SQL Express compress MDF file

Posted on 2009-04-15
Medium Priority
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

tonelm54 earned 0 total points
ID: 24152877
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")

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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…
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

580 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