MDF File with 40MB without any Data

Hi there,

I'm using a DataBase for tests, but now that it's completed and I erased all it's contents, I verify that the mdf file of the database have 40 MB, but I don't have any data on it.

It's that because whene the database grow's, then never comes dow to a small size

I whant upload the database to the server, but 40 MB ... :S 

There is any way to just copy the definition, stored proc., views, etc to a "clean" mdf file, or to make something like a garbage collect on the database

Thanks in advance. 

Alberto Ferreira


Answer this question

MDF File with 40MB without any Data

  • e1v

    You can shrink the database by using SQL Server Management Studio.  Right click on teh database in the Object Explorer, select Tasks, then Shrink, then Database.

    Here's a good forum post about the actual commands in use here: http://www.intermedia.net/support/kb/default.asp id=996.

    Thanks< MJ

  • MDF File with 40MB without any Data