truncate transaction log in SQL-SERVER

Article about truncating the transaction log. some time in live environtment especially in big database, it might happens when you shrink the database log file, it dosn't shrink. here is the solution in this article.

Many times, it happens in live sql server which has big transaction log file, you run DBCC SHRINKFILE command and see no effect of it on the transaction log file. You can use following magical five line at that time and you will done. It shrinks the trucated log File to minimum size possible.

USE DBName
GO
DBCC SHRINKFILE(<logfilename>, 1)
BACKUP LOG WITH TRUNCATE_ONLY
DBCC SHRINKFILE(<logfilename>, 1)

We will go in depth study for internal working of transaction log soon in my future article. 
Happy Working!!!!

Reference: Ritesh Shah

By Ritesh Shah   Popularity  (3352 Views)
Biography - Ritesh Shah
I am Ritesh Shah and currently working as IT Project Leader in one KPO of Environment Laboratory located at NJ, USA area. I have been working with Microsoft technology since last 8+ years and having sound knowledge in SQL-Server, Asp.NET and C#. I have been working as a Project Leader & Pricipal Database Administrator in my current job since 3+ year. You can further read my blogs at SQLHub.Com