SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

How do I look at my error log if SQL won’t open?

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.

Parameter -e

-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.

SQLStudies

My name is Kenneth Fisher and I am Senior DBA for a large (multi-national) insurance company. I have been working with databases for over 20 years starting with Clarion and Foxpro. I’ve been working with SQL Server for 12 years but have only really started “studying” the subject for the last 3. I don’t have any real "specialities" but I enjoy trouble shooting and teaching. Thus far I’ve earned by MCITP Database Administrator 2008, MCTS Database Administrator 2005, and MCTS Database Developer 2008. I’m currently studying for my MCITP Database Developer 2008 and should start in on the 2012 exams next year. My blog is at www.sqlstudies.com.

Comments

Leave a comment on the original post [sqlstudies.com, opens in a new window]

Loading comments...