Quickly Shrink SQL Server Transaction Logs

 

Note: Truncating logs is generally a bad idea.

Further, this didn't work for me once... a simpler system that I figured out was to change the database to simple logging instead of bulk-logged or full. Then use the SQLEM shrink log option.  Then switch back to full logging. 

/*
From: http://www.eggheadcafe.com/community/aspnet/9/10012663/very-easy-way-to-truncate.aspx
Retrieved: 2008-04-15

make sure you do a full backup first!

backup log [database name] with truncate_only
(run this in query analyzer)

(open enterprise manager and expand the server tree)
--right click on the database
--all task
--shrink database
--bottom button (on right side of form) for files
--select sql log file (default is data file so make sure and change it)
--click ok
*/
backup log northwind with truncate_only


tags: msde, sqlserver, mssql,

Related Scribbles:
  • List Databases MSSQL
  • SQL Server - Move a database manually via SQL
  • SQL Server


  • ID: 900
    Author:
    leonard
    Date Updated:
    2011-11-03 14:01:22
    Date Created:
    2008-04-15 14:12:00

    Edit

    Comments?
     >> Leonard Chan's Homepage  >> Scribble Web  >> Quickly Shrink SQL Server Transaction Logs
    leonard.lotus-land.ca is hosted by Perceptus Solutions Inc.