Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

view behind xp_readerrorlog

Posted on 2011-09-19
7
Medium Priority
?
471 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 1336 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
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 
LVL 10

Assisted Solution

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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

824 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