How to search error from SQL Server error log or SQL Server Agent Log?


How to search error from SQL Server error log or SQL Server Agent Log?

We can find the particular error or information from error log by passing below parameters to XP_ReadErrorLog extended procedure.


EXEC 
sys.xp_readerrorlog @p1,@p2,@p3,@p4

@P1 = Value of error log file you want to read: 0 = current, 1 = Archive #1, 2 = Archive #2, etc…

@P2 = Log file type: 1 or NULL = error log, 2 = SQL Agent log

@P3 = Search string 1: String one you want to search for

@P4 = Search string 2: String two you want to search for to further refine the results

Please note all the parameters are optional.

Advertisements

One thought on “How to search error from SQL Server error log or SQL Server Agent Log?

Thanks for the comment, will get back to you soon... Jugal Shah

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s