How to Reduce/Shrink the SQL Server Database Size?

Method 1: Using SQL Server Management Studio

Follow the steps as given below to shrink or reduce the SQL Server database size (.MDF and .LDF).

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

shrink-1

Step 2: Then Click OK.

shrink-2

Method 2: Using Transact SQL Command

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

Step 1: Open SQL Server Management Studio.

Step 2: Connect to the Database Engine.

Step 3: From the Standard bar, click New Query.

shrink-3

Step 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

shrink-4

Now you have shrunk the database size successfully!