Thursday, January 12, 2017

SQL Server ErrorLog Location

Sometimes as a DBA we need to Invetsigate the SQL errors. SQL Server stores errors in error logs, which can be fined in no of ways.

Finding the location of log file.

Error log file location can be found in startup parameters of instance. You need to go to SQL Server configuration manager, select the SQL Server Services on Left pane and select the instance you are interested. Right click properties and select parameters, the parameter which start with -e is the location of your error log file for the selected instance.


The other ways to find out the error log file location is using xp_readerrorlog and from registry keys. The below is the T SQL can be used.

EXEC master.dbo.xp_readerrorlog 0, 1, 'Logging SQL Server messages in file'


1 comment: