The ERRORLOG files that you come across in MS SQL logs folder can grow significantly in size and consume large amounts of storage over time.
You might be thinking the same as what I was thinking when I first browsed to this location.
SHIFT + Delete !
You can actually get away with this on the archived logs i.e. ERRORLOG. 1, ERRORLOG. 2, etc..
But you must retain the current active log which will be named just ERRORLOG.
The above method is quick and it works, but it is not the most graceful way to get rid of them.
Follow these steps to delete them the much safer 'recommended' way:
Open SQL Server Management Studio (SSMS) and connect to your SQL Server instance.
Select the Databases section & click New Query.
Run the following command:
EXEC sp_cycle_errorlogThis stored procedure closes the current error log, archives it, creates a new one automatically. The older logs will be renamed sequentially.
You will still have to go and manually delete the archived logs however... I know, it doesn't do that for you.
I suggest its best to automate this process in a routine maintenance to cycle the error logs and then delete the archived ones.
0 Comments