Click here to Skip to main content
15,879,535 members
Articles / Database Development
Alternative
Tip/Trick

How to Shrink SQL Server database log files?

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
8 Feb 2010CPOL 9.2K   5   1
DUMP TRANSACTION FooDB WITH NO_LOGBACKUP LOG FooDB WITH NO_LOGDBCC SHRINKDATABASE(FooDB)EXEC sp_dboption 'FooDB', 'autoshrink', 'TRUE'
SQL
DUMP  TRANSACTION  FooDB  WITH  NO_LOG
BACKUP LOG FooDB WITH NO_LOG
DBCC SHRINKDATABASE(FooDB)
EXEC sp_dboption 'FooDB', 'autoshrink', 'TRUE'

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Product Manager www.xnlab.com
Australia Australia
I was born in the south of China, started to write GWBASIC code since 1993 when I was 13 years old, with professional .net(c#) and vb, founder of www.xnlab.com

Now I am living in Sydney, Australia.

Comments and Discussions

 
Generaldump functionality has been removed with SQL Server 2008 Pin
Simon_Whale18-Oct-10 1:13
Simon_Whale18-Oct-10 1:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.