You are currently offline, waiting for your internet to reconnect

Your browser is out-of-date

You need to update your browser to use the site.

Update to the latest version of Internet Explorer

Error message when you shrink the transaction log file of a database in SQL Server: "Cannot shrink log file ..."

Extended support for SQL Server 2005 ends on April 12, 2016

If you are still running SQL Server 2005 after April 12, 2016, you will no longer receive security updates and technical support. We recommend upgrading to SQL Server 2014 and Azure SQL Database to achieve breakthrough performance, maintain security and compliance, and optimize your data platform infrastructure. Learn more about the options for upgrading from SQL Server 2005 to a supported version here.

SYMPTOMS
When you run a DBCC SHRINKFILE command in SQL Query Analyzer to shrink the specified transaction log file of a database, the transaction log file does not shrink, and you may receive the following error message:

Cannot shrink log file <transaction log file ID> (<transaction log file name>) because total number of virtual log files cannot be fewer than 2.
MORE INFORMATION
When a transaction log file has two virtual log files, you cannot shrink the transaction log file by using the DBCC SHRINKFILE command.
REFERENCES
For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
272318 Shrinking the transaction log in SQL Server 2000 with DBCC SHRINKFILE

324432 DBCC SHRINKFILE and SHRINKDATABASE commands may not work because of sparsely populated text, ntext, or image columns

80629 Transaction log partially truncated

317375 Transaction log grows unexpectedly or becomes full on SQL Server


For more information, visit the following Microsoft Web sites:
Shrinking the Transaction Log

DBCC SHRINKFILE

Attaching and Detaching a Database
Properties

Article ID: 814574 - Last Review: 05/31/2007 01:47:40 - Revision: 5.6

  • Microsoft SQL Server 2000 Standard Edition
  • Microsoft SQL Server 2005 Standard Edition
  • Microsoft SQL Server 2005 Developer Edition
  • Microsoft SQL Server 2005 Enterprise Edition
  • Microsoft SQL Server 2005 Express Edition
  • Microsoft SQL Server 2005 Workgroup Edition
  • kbsysadmin kbprb KB814574
Feedback
ript' src='" + (window.location.protocol) + "//c.microsoft.com/ms.js'><\/script>");