Shrink SQL Database Transaction Log

I was migrating a large-ish (~1GB) database from one server (MS SQL Server 2008) to another (MS SQL Server 2014), with a full transaction log. The transaction log uncompressed and restored was ~230GB.

As this was a new server, with a new set of backup and disaster recovery procedures, I decided to do a full backup, and then completely truncate the transaction log.

Your Transaction Log could be crucially important in a recovery scenario, do not just do this because it's big and you want it to be small - it has a purpose.

MS SQL Server 2014 (2008/R2+):
ALTER DATABASE <DatabaseName> set recovery simple
GO
CHECKPOINT
GO
DBCC SHRINKFILE (<TransactionLog>,1)
GO
ALTER DATABASE <DatabaseName> set recovery full
GO   
MS SQL Server 2005:
USE <DatabaseName>
GO
DBCC SHRINKFILE (<TransactionLog>, 1)
BACKUP LOG <DatabaseName> WITH TRUNCATE_ONLY
DBCC SHRINKFILE(<TransactionLog>, 1)
GO

Query: Source
GUI: Source