Solved

view behind xp_readerrorlog

Posted on 2011-09-19
7
451 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
Free eBook: Backup on AWS

Everything you need to know about backup and disaster recovery with AWS, for FREE!

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
monitoring configuration for SQL server DB 32 45
SQL Database - Move Tables from one Database to Another 4 43
push and Pull replication 31 46
Need time in SQL 8 30
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
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.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

713 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