<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>xp_readerrorlog &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/xp_readerrorlog/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Wed, 11 Oct 2017 10:54:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<item>
		<title>SQL Server: How to read database error log using T-SQL (xp_readerrorlog)</title>
		<link>https://www.dbrnd.com/2016/03/sql-server-how-to-read-database-error-log-using-t-sql-xp_readerrorlog/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 27 Mar 2016 21:00:27 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[error logs]]></category>
		<category><![CDATA[SQL Query]]></category>
		<category><![CDATA[SQL Server Administrator]]></category>
		<category><![CDATA[SQL Server Monitoring]]></category>
		<category><![CDATA[SQL Server Performance Tunning]]></category>
		<category><![CDATA[SQL Server Tips and Tricks]]></category>
		<category><![CDATA[TSQL]]></category>
		<category><![CDATA[xp_enumerrorlogs]]></category>
		<category><![CDATA[xp_readerrorlog]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2057</guid>

					<description><![CDATA[This is one of the important articles for all Database Administrators who are playing with the SQL Server Error Logs. Generally, we are checking an error log file for monitoring and troubleshooting errors in SQL Server. But the problem is when we are finding the errors for a particular process, it is difficult to filter [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-how-to-read-database-error-log-using-t-sql-xp_readerrorlog%2F&amp;linkname=SQL%20Server%3A%20How%20to%20read%20database%20error%20log%20using%20T-SQL%20%28xp_readerrorlog%29" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-how-to-read-database-error-log-using-t-sql-xp_readerrorlog%2F&amp;linkname=SQL%20Server%3A%20How%20to%20read%20database%20error%20log%20using%20T-SQL%20%28xp_readerrorlog%29" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-how-to-read-database-error-log-using-t-sql-xp_readerrorlog%2F&amp;linkname=SQL%20Server%3A%20How%20to%20read%20database%20error%20log%20using%20T-SQL%20%28xp_readerrorlog%29" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-how-to-read-database-error-log-using-t-sql-xp_readerrorlog%2F&amp;linkname=SQL%20Server%3A%20How%20to%20read%20database%20error%20log%20using%20T-SQL%20%28xp_readerrorlog%29" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-how-to-read-database-error-log-using-t-sql-xp_readerrorlog%2F&amp;linkname=SQL%20Server%3A%20How%20to%20read%20database%20error%20log%20using%20T-SQL%20%28xp_readerrorlog%29" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-how-to-read-database-error-log-using-t-sql-xp_readerrorlog%2F&amp;linkname=SQL%20Server%3A%20How%20to%20read%20database%20error%20log%20using%20T-SQL%20%28xp_readerrorlog%29" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F03%2Fsql-server-how-to-read-database-error-log-using-t-sql-xp_readerrorlog%2F&#038;title=SQL%20Server%3A%20How%20to%20read%20database%20error%20log%20using%20T-SQL%20%28xp_readerrorlog%29" data-a2a-url="https://www.dbrnd.com/2016/03/sql-server-how-to-read-database-error-log-using-t-sql-xp_readerrorlog/" data-a2a-title="SQL Server: How to read database error log using T-SQL (xp_readerrorlog)"></a></p><p>This is one of the important articles for all Database Administrators who are playing with the SQL Server Error Logs.</p>
<blockquote><p>Generally, we are checking an error log file for monitoring and troubleshooting errors in SQL Server.<br />
But the problem is when we are finding the errors for a particular process, it is difficult to filter a specific error.</p></blockquote>
<p>In this post, I am providing the script for manipulating all error logs using T-SQL.</p>
<p><strong>Script to list out all error log files: </strong><br />
You can find the list of error log files with a file size and Archive File number.</p><pre class="crayon-plain-tag">xp_enumerrorlogs</pre><p>
<a href="https://www.dbrnd.com/wp-content/uploads/2016/03/SQLServerErrorLogFiles.png" rel="attachment wp-att-2061"><img decoding="async" class="alignnone wp-image-2061 size-full" title="SQL Server Error Log Files" src="https://www.dbrnd.com/wp-content/uploads/2016/03/SQLServerErrorLogFiles.png" alt="SQL Server Error Log Files" width="294" height="159" srcset="https://www.dbrnd.com/wp-content/uploads/2016/03/SQLServerErrorLogFiles.png 294w, https://www.dbrnd.com/wp-content/uploads/2016/03/SQLServerErrorLogFiles-150x81.png 150w" sizes="(max-width: 294px) 100vw, 294px" /></a></p>
<p><strong>Script to SELECT error log of a particular file by giving a file number: </strong><br />
File number &#8216;0&#8217; is for current file.<br />
<pre class="crayon-plain-tag">EXEC [master].[dbo].[xp_readerrorlog] 0</pre>
<p><strong>CREATE TEMP table and store all error logs for better manipulation:</strong><br />
<pre class="crayon-plain-tag">CREATE TABLE #TempErrorLogs
(
	[LogDate] DATETIME 
	,[ProcessInfo] VARCHAR(50)
	,[Text] VARCHAR(MAX)
) 
GO

INSERT INTO #TempErrorLogs 
([LogDate], [ProcessInfo], [Text])
EXEC [master].[dbo].[xp_readerrorlog] 0 
GO</pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
