Monday, 18 August 2014

How to purge Log in SqlServer Database



Step1: Open the SQL Server Management Studio by choosing Start > Programs > Microsoft SQL Server 2008 > SQL Server Management Studio.

Step2:  right-click on Database and open new sql query and execute following query to shrink Database log file to 20MB

USE [DB_NAME]
GO
ALTER DATABASE [DB_NAME] SET RECOVERY SIMPLE WITH NO_WAIT
dbcc shrinkfile(DB_Log_File_Name,20)
ALTER DATABASE [DB_NAME] SET RECOVERY FULL WITH NO_WAIT
GO

Note: Above colored texts are variable

USE [servicedesk]
GO
ALTER DATABASE [servicedesk] SET RECOVERY SIMPLE WITH NO_WAIT
dbcc shrinkfile(servicedesk_log,20)
ALTER DATABASE [servicedesk] SET RECOVERY FULL WITH NO_WAIT
GO

1 comment:

  1. Jadwal Sambung Ayam SV388 3 Maret 2019 - Minggu, Medan 3 Maret 2019 – Pada Hari Tersebut Akan Di Laksanakan Berbagai Pertandingan Sabung Ayam Secara Live di Arena Sabung Ayam Thailand.

    Situs Judi Sabung Ayam Online SV388 Merupakan Situs Judi Asal Thailand Yang Sangat Terkenal Dengan Permainan Sabung Ayam Yang Fair dan Menghibur Para Penonton Judi Sabung Ayam.

    Untuk Info Lebih Lanjut Bisa Hub kami Di :
    wechat : bolavita
    line : cs_bolavita
    whatsapp : +628122222995
    BBM: BOLAVITA

    ReplyDelete