-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreadErrorLog.sql
More file actions
22 lines (17 loc) · 929 Bytes
/
readErrorLog.sql
File metadata and controls
22 lines (17 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Declare @InstanceName nvarchar(4000),
@LogType int,
@ArchiveID int,
@Filter1Text nvarchar(4000),
@Filter2Text nvarchar(4000),
@FirstEntry datetime,
@LastEntry datetime,
@order nvarchar(10)
Select @InstanceName=NULL, -- Don't know
@LogType = 1, -- File Type (1 = ERRORLOG OR 2 = SQLAgent)
@ArchiveID=0, -- File Extension (0 = Current i.e. ERRORLOG or SQLAgent.out, 1 = ERRORLOG.1 or SQLAgent.1 and so on)
@Filter1Text=NULL, -- First Text Filter
@Filter2Text=NULL, -- Second Text Filter
@FirstEntry=NULL, -- Start Date
@LastEntry=NULL, -- End Date
@order='desc' -- sort order (asc or desc)
EXEC lumberjack.master.dbo.xp_readerrorlog @ArchiveID, @LogType, @Filter1Text, @Filter2Text, @FirstEntry, @LastEntry, @order, @InstanceName