| Login

Search this Blog

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

Written by:R Teachout
11/18/2006 7:21 PM 

MSSQL Database

use master
dump tran your_database_name with no_log
use your_database_name
dbcc shrinkdatabase (database_name, 4, notruncate )

Tags:

1 comment(s) so far...

Re: SQL:Dump Transaction log + free space

UPDATE: for SQL 2008, this command has been depricated, and no longer works
If you need to do an immediate dump, without backing it up, here's a solution
(in my example, the name of the database is "log_db"

USE [master]
GO
USE [log_db]
ALTER DATABASE [log_db] SET RECOVERY SIMPLE WITH NO_WAIT
GO
-- This is the name of my "log" tran file - edit the database, click on "files" to get the name if it is not standard
DBCC SHRINKFILE ('Log_db_log' , 1)
GO
USE [master]
GO
ALTER DATABASE [log_db] SET RECOVERY FULL WITH NO_WAIT
GO

By Rich on  10/16/2009 12:44 PM

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 


-QuoteDB.com

Inspired by Nina