Published
Wednesday, December 14, 2005 10:36 PM
by
robertvv
While I was searching for a way to determine the backup status of SQL databases, I came across the following Stored Procedure: "sp_readerrorlog". However, it's not documented in the SQL Servers books online. After some googling, I decided to use a trial and error method to find out how it can be used. It was obvious the stored procedure accepts up to 4 parameters and after some 15 minutes trial and error for the different combinations, I came to the following conclusion for the stored procedure's syntax:
exec sp_readerrorlog @1, @2, @3, @4
where:
@1 = Log file number (0=current).
@2 > 1 = Info.
2 = Warning/Error
@3 = Search param #1
@4 = Search param #2
Of course since it's not documented, at least I couldn't find it, it's an assumed syntax.