Home » Blog » Topic » Deleting a Transaction Log File in SQL Server

Deleting a Transaction Log File in SQL Server

Stephen West ~ Modified: March 26th, 2016 ~ ~ 1 Minute Reading

Home Forums Deleting a Transaction Log File in SQL Server

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #279 Score: 0
    Stephen West
    Moderator
    4 pts

    How Can I Delete a Transaction Log File In SQL Server database?

    #319 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    In SQL Server, to DELETE a log file in SQL Server just click on OBJECT EXPLORER and connect to the SQL Server database engine then expand DATABASES and right click on the database to which log file you have to delete and then click on properties and select the file page.
    NOW, In the DATABASE FILES grid, select the file to delete and then click on REMOVE then click OK.

    PS: The file must be empty before it can be delete.

    #778 Score: 0
    Lincoln Burrows
    Moderator
    16 pts

    Connect to the Database Engine and execute the following query

    USE master;
    GO
    ALTER DATABASE AdventureWorks2012
    REMOVE FILE testfile;
    GO
    #1695 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    Yes, you can delete a log file but it is recommended that the file that you want to delete must be empty. You can delete a transaction log file with the help of SQL Server Management Studio also.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.