Useful-SqlServer-Scripts

Some useful Scripts

As a DBA/Developer, there have been many occasions where I had to write my own scripts/automation to fulfill specific business requirements. Below are some of those useful scripts that I…
Remove High VLF in SQL Server Log Files

Get Rid of High VLF Easily

Remove High Virtual Log File (VLF) (@OptimizeLogFiles) This generates TSQL code for removing huge virtual log files (VLFs) from SQL Server database log files. By default, @vlfCountThreshold is 500. So any log file with VLF count greater than @vlfCountThreshold will be considered for SHRINKFILE operation, Regrow to original Size in appropriate size chunk, and finally reset the AutoGrowth settings. Space-Capacity-Automation url:- https://github.com/imajaydwivedi/Space-Capacity-Automation