| Login

Search this Blog

Here are the most recent postings to this blog. Use the archive calendar or search to find other entries.
Jun24

Written by:R Teachout
6/24/2010 2:58 PM 

NOTE: THIS THIS SHOULD ONLY BE USED AS A LAST RESORT TO FREE SPACE IN AN EMERGENCY (such as when you have a server drive with 1Mb free, and have to free space to prevent the databases from causing errors)

USE AT YOUR OWN RISK

exec sp_MSforEachDb 'print "[?]"; USE [?];ALTER DATABASE [?] SET RECOVERY SIMPLE WITH NO_WAIT;'
exec sp_MSforEachDb 'print "[?]"; USE [?]; DBCC SHRINKFILE ("?_log" , 1);'
exec sp_MSforEachDb 'print "[?]"; USE [?];ALTER DATABASE [?] SET RECOVERY FULL WITH NO_WAIT;'

Tags:

Your name:
Your email:
(Optional) Email used only to show Gravatar.
Your website:
Title:
Comment:
Security Code
CAPTCHA image
Enter the code shown above in the box below
Add Comment  Cancel 

It's Suprising how much you can get done. - If you don't care who gets the credit.
-Harold Warp

Inspired by Nina