Home SQL Server How to truncate a SQL Server Data file

How to truncate a SQL Server Data file

0
1914

How to truncate a SQL Server Data file.

While working with SQL Server, for some reason your database log file (.ldf file) keeps increasing in size.
to reduce the size of the log file … I just followed the below mentioned steps.

Open Microsoft SQL Server Management Studio
Select and Right click on your database then Select Properties.
Click on Options and Change the recovery model to Simple.
Click OK. as per the image – 1

How to truncate a SQL Server Data file

Image – 1

Right click on the selected database for which you are trying to reduce the log file size.
Select Tasks > Shrink > Database.
Click OK. as per image – 2

How to truncate a SQL Server Data file

Image – 2

You are now in Shrink Database page and Here you can see Database name and Database size
Currently allocated space must be in GB’s and available free space must be 1%.
in the image – 3 it’s the picture of after shrinking the database log file.

How to truncate a SQL Server Data file

Image – 3

so now click Ok to run execution.. it will take some time depending up on how large is the log file.
once done now click ok and come out of Srink database page.
and change back the recovery model to full.

Right click on the database.
Select Properties.
Click on Options.
Change the recovery model to Full.
Click OK. as per image – 4

How to truncate a SQL Server Data file

Image – 4

You may also like: Failed to connect to MySQL at with user root cannot connect to MySQL server on (10060)


NO COMMENTS

LEAVE A REPLY

Please enter your comment!
Please enter your name here