Bru Medishetty's SeekWell Blogs
Archive for December 1, 2009
View SQL Server Error Logs through T-SQL
Dec 1st
When SQL Server error log is not initialized at a regular interval causing the error log file to grow into a huge file. Viewing that in the SQL Log File Viewer would be a time consuming task.
This article will show how to view the SQL Server error log from a query analyzer in 2000 or query editor in later versions. As an additional benefit this code filters the log file and displays only the past 24 hours (default code).
To view SQL Server error logs in SQL Server 2000

To view SQL Server error logs in SQL Server 2005 / 2008
The script can be changed to display only data for the past n # of hours by changing the value of @Hours.
–Bru Medishetty

Recent Comments