Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 reduce .mdf file size in

Author  Topic 

nektarios
Starting Member

3 Posts

Posted - 2012-09-17 : 04:12:17
hello ,

I am running sql server 2005.
I have a database that the .mdf file is 20GB.
I clean the .ldf file and I delete the records from the tables
but still the .mdf file is at the size of 20GB.
How can I reduce the size ?

Thanks in advance !

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2012-09-17 : 04:16:53
Deleting the Records doesn't reduce the .mdf file, because Sql server doesn't release the space if you delete the records.

You have to shrink the Data file (.mdf)


Senthil Kumar C
------------------------------------------------------
MCITP - Database Administration SQL SERVER 2008
MCTS - Database Development SQL SERVER 2008
Go to Top of Page

nektarios
Starting Member

3 Posts

Posted - 2012-09-17 : 04:20:33
if I shrink the data file while not compress the existings records ?
Go to Top of Page

senthil_nagore
Master Smack Fu Yak Hacker

1007 Posts

Posted - 2012-09-17 : 04:25:56
Shrinking will de-allocate the unused space.

refer : http://blog.sqlauthority.com/2009/01/25/sql-server-shrinking-ndf-and-mdf-files-a-safe-operation/

Senthil Kumar C
------------------------------------------------------
MCITP - Database Administration SQL SERVER 2008
MCTS - Database Development SQL SERVER 2008
Go to Top of Page

nektarios
Starting Member

3 Posts

Posted - 2012-09-17 : 05:35:56
thank you for your time
Go to Top of Page
   

- Advertisement -