Unable to shrink the logs file in Mssql 2012

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Aidan B
    replied
    Re: Unable to shrink the logs file in Mssql 2012

    Hello,

    Thanks for your reply it really works.

    Regards,
    Aidan B

    Leave a comment:


  • PMagic
    replied
    Re: Unable to shrink the logs file in Mssql 2012

    Hi Aidan,

    You can use the following query to shrink the database log file :

    USE [Database_Name]
    GO
    ALTER DATABASE [Database_Name] SET RECOVERY SIMPLE WITH NO_WAIT
    DBCC SHRINKFILE(Database_Name_log, 1)
    ALTER DATABASE [Database_Name] SET RECOVERY FULL WITH NO_WAIT
    GO

    Regards,

    Leave a comment:


  • Aidan B
    started a topic Unable to shrink the logs file in Mssql 2012

    Unable to shrink the logs file in Mssql 2012

    Hello,

    I am unable to shrink the database log files in Mssql 2012. I am using the below query for it.
    -------------------------------------------------------------
    BACKUP LOG "Databasename" WITH TRUNCATE_ONLY
    DBCC SHRINKFILE (Databasename_Log', 1)
    -------------------------------------------------------------
    Can anyone help me please.

    Regards,
    Aidan.
Working...
X