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
- Right-click on the database name >> Tasks >> Shrink >> Database.
- Then Click OK.
Method 2: Using Transact SQL Command
Follow the steps to shrink or reduce the SQL Server database size using SQL command.
- Open SQL Server Management Studio.
- Connect to the Database Engine.
- From the Standard bar, click New Query.
- 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
Now you have shrunk the database size successfully!
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