Shrinking SQL Server logs

Here is a great little script that comes in handy when you need to shrink your transaction logs.Not really meant for production systems though!


USE MyDatabase
GO
Backup Log MyDatabase WITH TRUNCATE_ONLY
GO
DBCC SHRINKFILE (MyDatabase_Log, 1)
GO