sp_readerrolog accepts 4 parameters
The extended stored procedure accepts 7 parameters.
If this extended stored procedure is called directly the
parameters are as follows:
- #
error log file to read: 0 = current, 1 = Archive #1, 2 =
Archive #2, etc...
- Log
file type:
1 or NULL = error log, 2 = SQL Agent log
- Search
string 1: String
one you want to search for
- Search
string 2:
String two you want to search for to further refine the results
- Search
from start time
- Search
to end time
- Sort
order for results: N'asc' = ascending, N'desc' =
descending
To search with string (Error, 112)
EXEC
xp_readerrorlog 0
,
1
,
'2005'
,
'exec'
, NULL, NULL,
N'desc'
To search with datetime range:
EXEC
xp_readerrorlog
0
,
1
,
null
,
null
,
startdate,enddateEXEC
xp_readerrorlog
0
,
1
,
null
,
“error”
,
'2015-01-09 00:38:49.460','2015-01-09 23:38:49.460’
No comments:
Post a Comment