|
This week each day, I'll cover a new documented and undocumented extended stored procedure. These will be fairly short in description to save space but for the full details, see my book entitled SQL Server 2000 for the Experienced DBA at http://www.amazon.com/exec/obidos/ASIN/0072227885/sqlservercent-20. There is quite a bit of undocumented stored procedures and DBCC commands in the book as well as other advanced topics.
Today's sproc is another useful one that I use in my management scripts to remotely see the SQL Server error log. Xp_readerrorlog will show you a given SQL Server error log and is useful when you want to quickly debug an issue via Query Analyzer without having to open the slower Enterprise Manager. I also like to loop through the error log in ADO using xp_readerrorlog to look for keywords like "ERROR" or "LOGIN FAILED" and act upon those accordingly. To execute the stored procedure, you can run it without any parameters as shown below:
master..xp_readerrorlog
or you can call a given error log from the archive (like ERRORLOG.5) by typing the error log that you wish to see after the stored procedure as shown below:
master..xp_readerrorlog 5 |