SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Reducing MDF size after delete records
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

vna_mhars
Starting Member

Philippines
37 Posts

Posted - 01/09/2013 :  22:48:11  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 01/09/2013 :  23:03:34  Show Profile  Reply with Quote
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

Philippines
37 Posts

Posted - 01/09/2013 :  23:50:44  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
7174 Posts

Posted - 01/11/2013 :  14:20:31  Show Profile  Reply with Quote
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 - 01/15/2013 :  08:50:00  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000