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
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Reducing MDF size after delete records

Author  Topic 

vna_mhars
Starting Member

37 Posts

Posted - 2013-01-09 : 22:48:11
Hi,
I have a database size 125GB of .mdf, I transferred some records base from the retention period of records. so from year 2002 - 2007 was transferred to a new database and then deleted to original database. After the deletion my database size still the same. .mdf still 125GB.

My question is, how to reduce the size of .mdf data since I deleted lots of records. I'm using SQL2008

Thanks,
vna


vamodente

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-01-09 : 23:03:34
see

http://blog.strictly-software.com/2012/08/shrinking-ms-sql-database-mdf-file.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

vna_mhars
Starting Member

37 Posts

Posted - 2013-01-09 : 23:50:44
Hi, THank you for immediate response. I have doubt in using DBCC Shrinkfile due to the disk fragmentation, however I tried this one in testDB, I also tried the DBCC ShrinkDatabase but I'm still looking for other alternatives.

quote:
Originally posted by visakh16

see

http://blog.strictly-software.com/2012/08/shrinking-ms-sql-database-mdf-file.html

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/





vamodente
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2013-01-11 : 14:20:31
Yes it will cause huge fragmentation for indexes and pages.

Check this out from Paul Randal for alternative:
http://www.sqlskills.com/blogs/paul/why-you-should-not-shrink-your-data-files/
Go to Top of Page

srimami
Posting Yak Master

160 Posts

Posted - 2013-01-15 : 08:50:00
The other solution would be Alter Table with rebuild option, I haven't tried it for un-allocated space though but definitely works for unused space.
Go to Top of Page
   

- Advertisement -