﻿<?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>SQL Server’da Hata Dosyalarını Okuma &#8211; SQL Server Eğitimleri</title>
	<atom:link href="https://sqlserveregitimleri.com/etiket/sql-serverda-hata-dosyalarini-okuma/feed" rel="self" type="application/rss+xml" />
	<link>https://sqlserveregitimleri.com</link>
	<description>SQL Server ile ilgili her şey</description>
	<lastBuildDate>Sat, 21 Apr 2018 20:25:15 +0000</lastBuildDate>
	<language>tr</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.1</generator>
	<item>
		<title>SQL Server’da Hata Dosyalarını Okumak</title>
		<link>https://sqlserveregitimleri.com/sql-serverda-hata-dosyalarini-okumak</link>
		
		<dc:creator><![CDATA[Yavuz Selim Kart]]></dc:creator>
		<pubDate>Fri, 27 Apr 2018 19:00:58 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server’da Hata Dosyaları]]></category>
		<category><![CDATA[SQL Server’da Hata Dosyalarını Okuma]]></category>
		<category><![CDATA[SQL Server’da Hata Dosyalarını Okumak]]></category>
		<guid isPermaLink="false">http://sqlserveregitimleri.com/?p=5742</guid>

					<description><![CDATA[Herkese merhaba, Bu kısımda SQL Server’da hata dosyalarını okuma kodları olacak. ------------------------------------------------------------ -- Drop temp tables if exists ------------------------------------------------------------ IF OBJECT_ID(N'tempdb..##tbl_sql_error_log') IS NOT NULL BEGIN DROP...]]></description>
										<content:encoded><![CDATA[<p>Herkese merhaba,</p>
<p>Bu kısımda SQL Server’da hata dosyalarını okuma kodları olacak.</p>
<pre class="lang:default decode:true ">------------------------------------------------------------
-- Drop temp tables if exists
------------------------------------------------------------

IF OBJECT_ID(N'tempdb..##tbl_sql_error_log') IS NOT NULL 
    BEGIN  
        DROP TABLE ##tbl_sql_error_log 
    END 
IF OBJECT_ID(N'tempdb..#ErrLogsDL') IS NOT NULL 
    BEGIN  
        DROP TABLE #ErrLogsDL 
    END
DECLARE @site_value INT;
DECLARE @NumberOfLogfiles INT;

------------------------------------------------------------
-- Create temp table to hold results from xp_enumerrorlogs
------------------------------------------------------------
CREATE TABLE #ErrLogsDL
(
[Archive #] INT,
[Date] VARCHAR(255),
[Log File Size (Byte)] BIGINT
)

---------------------------------------------------------------
-- Populate the temp table with
-- the data returned by executing xp_enumerrorlogs
---------------------------------------------------------------
INSERT #ErrLogsDL([Archive #],[Date], [Log File Size (Byte)])
EXEC master.dbo.xp_enumerrorlogs
     
SET @NumberOfLogfiles = (SELECT COUNT(*) FROM #ErrLogsDL);
--print @NumberOfLogfiles

------------------------------------------------------------------
-- Create temp table to hold results from ##tbl_sql_error_log data
------------------------------------------------------------------
create table ##tbl_sql_error_log (LogDate datetime,Processinfo nvarchar(max),[text] nvarchar (max))

SET @site_value = 0;
WHILE @site_value &lt; @NumberOfLogfiles
BEGIN
   insert into ##tbl_sql_error_log
exec sp_readerrorlog @site_value
SET @site_value = @site_value + 1;
END;


select*from ##tbl_sql_error_log
--where text like '%corrupt%' or text like '%19-25%'
order by logdate

drop table ##tbl_sql_error_log
drop table #ErrLogsDL

</pre>
<div class='epvc-post-count'><span class='epvc-eye'></span>  <span class="epvc-count"> 425</span><span class='epvc-label'> Kez Okundu</span></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
