How to Reduce/Shrink the SQL Server Database Size?

Here, we have explained all the important steps to shrink or reduce the SQL Server database size (.MDF and .LDF).

Method 1: Using SQL Server Management Studio

  1. Right-click on the database name >> Tasks >> Shrink >> Database.

    1

  2. Then Click OK. 

    2

Method 2: Using Transact SQL Command

Follow the steps to shrink or reduce the SQL Server database size using SQL command.

  1. Open SQL Server Management Studio.
  2. Connect to the Database Engine.
  3. From the Standard bar, click New Query. 

    3

  4. Type the following SQL command into the query window and click Execute.DBCC SHRINKDATABASE (DatabaseName, ‘target percent’)

— This command shrinks the test database

Example:

DBCC SHRINKDATABASE (test, 10);

GO

4

Now you have shrunk the database size successfully!