How to Reduce/Shrink the SQL Server Database Size

May 15, 2017 / MySQL

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!

More on this topic:

How to change the password of the MySQL root user

Why & How to Optimise & Repair MySQL Database using phpMyAdmin in cPanel

How to Import a MySQL Database in cPanel

 

Spread the love