October 22, 2018 by Kenneth Fisher
Quick and easy post today. Hopefully you’ve opened the error log on a SQL instance. However, what happens if you don’t have the log viewer in SSMS? In fact, the instance won’t come up at all so you really need to see what went wrong.
Fortunately, the error logs in SQL are just text files, even though they don’t actually have that extension. The trick is knowing where they are.
If you need to you can generally look up the location in the startup parameters in SQL Server Configuration Manager.
-eC:\Program Files\Microsoft SQL Server\MSSQL13.SQL2016CS\MSSQL\Log\ERRORLOG
This means that the log files will be in the log directory with the pattern ERRORLOG.[number]. Now, this is the directory for my log files. Yours should follow this pattern:
-e[InstallDrive]:\Program Files\Microsoft SQL Server\MSSQL[VersionNumber].[InstanceName]\MSSQL\Log\ERRORLOG
The current log file is ERRORLOG with the most recent one ERRORLOG.1. For each older one add 1 to the file extension. Note, that means that when you recycle the log (start a new log file) every file gets renamed, and the oldest one is deleted.
Anyway, once you’ve navigated to the path you can open any of the error log files up with notepad and easily read them. The most recent information will be at the bottom of the file.