Re: Shrinking MDF and LDF Files
- From: "David Portas" <REMOVE_BEFORE_REPLYING_dportas@xxxxxxx>
- Date: 16 Dec 2006 05:06:08 -0800
Greg wrote:
I have a SQL Server 2005 database I created several months back. Over time it
has grown rather large in size, for example my LDF File is now 400MB. I've
written a stored procedure that will delete all the data in all tables and
reseed my identity columns to zero.
With the database empty I'd like to SHRINK the database so the files are
their original sizes.
How can a achieve this. I've tried the Shrink Database command and nothing
happens.
Thanks.
Shrinking is almost never a good thing to do. There's a useful summary
about it here:
http://www.karaszi.com/SQLServer/info_dont_shrink.asp
If your log file is growing out of control then you aren't managing
your backups properly.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
.
- Follow-Ups:
- Re: Shrinking MDF and LDF Files
- From: Peter Yang [MSFT]
- Re: Shrinking MDF and LDF Files
- Prev by Date: Re: ADE problem
- Next by Date: Re: Unable to see triggers' error message on hp or acer computer
- Previous by thread: Re: Shrinking MDF and LDF Files
- Next by thread: Re: Shrinking MDF and LDF Files
- Index(es):
Relevant Pages
|