Where Is The SQL Server ErrorLog File?
October 19, 2010 6 Comments
I seldom lose things; I just cannot find them as quickly as I’d like. This is true for keys, tools, and yes even ErrorLog files on SQL Server.
On the servers that I configure, I have a standard way of doing things. I set them up using some industry best practices and some standards that I’ve developed over the years. On those servers, I can find the ErrorLog file quickly since it is in a predictable place for me.
Using T-SQL To Find The ErrorLog File
In my consulting practice, I regularly work with SQL Servers that I did not configure. For those servers, I must discover where things are. One technique that I use is to ask SQL Server itself where things are. For example, the following T-SQL query will return the location of the ErrorLog file.
SELECT SERVERPROPERTY(‘ErrorLogFileName’);
It will return something like the following:
E:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
This technique is particularly useful when I’m examining the ErrorLog in a PowerShell script. I blogged about that The Power Of RegEx in PowerShell.

Its particularly harder when the server is not starting up.
Then the only choice is to do a desktop search
If the SQL Server service can not start you can use SQL Server Configuration Manager, right-click your service, select Properties, Advanced, Startup Parameters and look for the -e parameter like in
-eC:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG
Thanks Ben!
Cool. Thanks for sharing that Benjamin!
Joe
Pingback: What SQL Server Service Pack Do I Have Installed? « WebbTech Solutions
Pingback: A NULL Is Not Unknown « WebbTech Solutions