Solved

view behind xp_readerrorlog

Posted on 2011-09-19
7
444 Views
Last Modified: 2012-05-12
is it possible to know which system proc/view works behind xp_readerrorlog?
0
Comment
Question by:25112
  • 3
  • 2
  • 2
7 Comments
 
LVL 5

Author Comment

by:25112
ID: 36563958
we are able to filter on this .. hence i would think there is a system table or view that is being used with a where condition..

example..
look at bottom example of
http://www.mssqltips.com/sqlservertip/1476/reading-the-sql-server-log-files-using-tsql/
0
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 334 total points
ID: 36564122
>>is it possible to know which system proc/view works behind xp_readerrorlog? <<
There is none.  It is an undocumented extended Stored Procedure to read text files.
0
 
LVL 10

Expert Comment

by:sqlservr
ID: 36564939
create proc sys.sp_readerrorlog(  
 @p1  int = 0,  
 @p2  int = NULL,  
 @p3  varchar(255) = NULL,  
 @p4  varchar(255) = NULL)  
as  
begin  
 
 if (not is_srvrolemember(N'securityadmin') = 1)  
 begin  
    raiserror(15003,-1,-1, N'securityadmin')  
    return (1)  
 end  
   
 if (@p2 is NULL)  
  exec sys.xp_readerrorlog @p1  
 else  
  exec sys.xp_readerrorlog @p1,@p2,@p3,@p4  
end  
 

check this out

0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 10

Assisted Solution

by:sqlservr
sqlservr earned 166 total points
ID: 36564953
internally xp_readerror user xpstar.dll for collecting the error log,
0
 
LVL 5

Author Comment

by:25112
ID: 36576893
>>There is none.  It is an undocumented extended Stored Procedure to read text files.

OK.. It is very interesting concept why the internals filters on text file thrugh a dll..

from what you understand, how do you see it filtering (like WHERE clause) on a text file? -so quickly...
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 334 total points
ID: 36577536
>>from what you understand, how do you see it filtering (like WHERE clause) on a text file?<<
Why is that so strange?  It is no doubt written in C++, since doing it in T-SQL would be horrendously slow.
0
 
LVL 5

Author Comment

by:25112
ID: 36577560
ah.. very good answer...
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now