Solved

view behind xp_readerrorlog

Posted on 2011-09-19
7
453 Views
Last Modified: 2012-05-12
is it possible to know which system proc/view works behind xp_readerrorlog?
0
Comment
Question by:25112
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:Ramesh Babu Vavilla
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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 10

Assisted Solution

by:Ramesh Babu Vavilla
Ramesh Babu Vavilla 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

734 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