Howto shrink / truncate SQL transaction log file in SQL Server 2005

USE <databasename>

GO

DBCC SHRINKFILE(‘<logfilename-logical name>’, 1)

BACKUP LOG <databasename> WITH TRUNCATE_ONLY

DBCC SHRINKFILE(‘<logfilename-logical name>’, 1)

GO

2 thoughts on “Howto shrink / truncate SQL transaction log file in SQL Server 2005

  1. Ulrich

    Hej Kenneth,

    Hvordan får man så lige Ahsay til at gøre dette efter hver fulde backup?

  2. admin Post author

    Skulle den vist gøre automatisk, bruger ikke ahsay længere, men prøv at spørge i deres forum.

Leave a Reply

Your email address will not be published. Required fields are marked *