Archive | Error Log RSS feed for this section

PowerShell to Remove Old SQL Error Logs

28 Feb


In a previous article article, I wrote about how to find out where the SQL Server error log is located. That particular article was in case your server instance did not start and you needed more information.

If your SQL Server instance is working, there is another way to find the location of the error logs – with a SQL query, which can then be used within PowerShell.

Continue reading

Finding the SQL Server Error Log

27 Mar

Having attempted to start an old test instance from SQL Server Configuration Manager, I received the wonderful error “The request failed or the service did not respond in a timely fashion. Consult the event log or other applicable error logs for details

Error From Configuration Manager

More helpful than some message you can get – at least it tells me where to look.

So, where is the error log for SQL Server? As I rarely need to access it and always forget how to find it, this small article has been written. I write these articles for myself – if anybody else finds them useful then that’s a bonus.

Configuration Manager is where the startup parameters can be seen, for the instance in question. The ‘-e’ parameter is the location of the error logs is stored.

Showing the location of the error log

So, looking in the file ‘ERRORLOG’, in the given location I can see that the creation of TempDB failed, due to a permissions issue (access denied).

Permissions issue with TempDB

To resolve this issue I checked the folder and the existing TempDB files were set to read-only. Who knows how that happened but the solution was easy enough. Having removed those files (because TempDB is re-created every time) the instance was able to start correctly and all is good in my world.

Of course, this won’t be the solution to every problem but at least you now know where to look for more information.