Useful SQL command to reduce the size of the database

February 6, 2018 · 1 min read
post MSSQL Tips and Tricks

今日想和大家分享一個 幾有用的TSQL Command, 去 Release 返一些SQL Server 佔用的空間
Transaction logDatabase file

-- select database
USE Production;

-- Change the recovery mode to SIMPLE, to clear the transaction log
ALTER DATABASE Production SET RECOVERY SIMPLE ;

-- shrink database to release space
DBCC SHRINKDATABASE (Production, 1);

Hope you find it useful