﻿<?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>Tabloları ve Index&#8217;leri Listelemek &#8211; SQL Server Eğitimleri</title>
	<atom:link href="https://sqlserveregitimleri.com/etiket/tablolari-ve-indexleri-listelemek/feed" rel="self" type="application/rss+xml" />
	<link>https://sqlserveregitimleri.com</link>
	<description>SQL Server ile ilgili her şey</description>
	<lastBuildDate>Fri, 16 Jun 2023 22:14:07 +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&#8217;da Veritabanındaki En Büyük Tabloları ve Index&#8217;leri Listelemek</title>
		<link>https://sqlserveregitimleri.com/sql-serverda-veritabanindaki-en-buyuk-tablolari-ve-indexleri-listelemek</link>
		
		<dc:creator><![CDATA[Yavuz Selim Kart]]></dc:creator>
		<pubDate>Mon, 12 Jun 2023 21:38:08 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[index boyutu listele]]></category>
		<category><![CDATA[tablo boyutu listele]]></category>
		<category><![CDATA[Tabloları ve Index'leri Listelemek]]></category>
		<guid isPermaLink="false">https://sqlserveregitimleri.com/?p=16476</guid>

					<description><![CDATA[Herkese merhaba. Bu yazıda SQL Server&#8217;da veritabanındaki en büyük tabloları ve index&#8217;leri listelemek ile ilgili bilgi vermeye çalışacağım. SQL Server&#8217;da bazı durumlarda veritabanındaki en büyük...]]></description>
										<content:encoded><![CDATA[<p>Herkese merhaba. Bu yazıda SQL Server&#8217;da veritabanındaki en büyük tabloları ve index&#8217;leri listelemek ile ilgili bilgi vermeye çalışacağım.</p>
<p>SQL Server&#8217;da bazı durumlarda veritabanındaki en büyük tabloları ve Index&#8217;leri listelemek isteyebilirsiniz.</p>
<p>Aşağıdaki kodu kullanarak sizler de bu işlemi rahatlıkla yapabilirsiniz.</p>
<p><strong>En Büyük Tabloları Listelemek</strong></p>
<pre class="line-numbers"><code class="language-sql">SELECT TOP 100
	s.[name] AS [schema]
   ,t.[name] AS [table_name]
   ,p.[rows] AS [row_count]
   ,CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS [size_mb]
   ,CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS [used_mb]
   ,CAST(ROUND(((SUM(a.total_pages) - SUM(a.used_pages)) * 8) / 1024.00, 2) AS NUMERIC(36, 2)) AS [unused_mb]
FROM sys.tables t
JOIN sys.indexes i
	ON t.[object_id] = i.[object_id]
JOIN sys.partitions p
	ON i.[object_id] = p.[object_id]
		AND i.index_id = p.index_id
JOIN sys.allocation_units a
	ON p.[partition_id] = a.container_id
LEFT JOIN sys.schemas s
	ON t.[schema_id] = s.[schema_id]
WHERE t.is_ms_shipped = 0
AND i.[object_id] &gt; 255
GROUP BY t.[name]
		,s.[name]
		,p.[rows]
ORDER BY [size_mb] DESC</code></pre>
<p><strong>En Büyük Index&#8217;leri Listelemek</strong></p>
<pre class="line-numbers"><code class="language-sql">SELECT TOP(100)
    s.[name] AS [schema],
    t.[name] AS [table_name],
    i.[name] AS [index_name],
    i.[type_desc],
    p.[rows] AS [row_count],
    CAST(ROUND(((SUM(a.total_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS [size_mb],
    CAST(ROUND(((SUM(a.used_pages) * 8) / 1024.00), 2) AS NUMERIC(36, 2)) AS [used_mb], 
    CAST(ROUND(((SUM(a.total_pages) - SUM(a.used_pages)) * 8) / 1024.00, 2) AS NUMERIC(36, 2)) AS [unused_mb]
FROM
    sys.tables t
    JOIN sys.indexes i ON t.[object_id] = i.[object_id]
    JOIN sys.partitions p ON i.[object_id] = p.[object_id] AND i.index_id = p.index_id
    JOIN sys.allocation_units a ON p.[partition_id] = a.container_id
    LEFT JOIN sys.schemas s ON t.[schema_id] = s.[schema_id]
WHERE 
    t.is_ms_shipped = 0
    AND i.[object_id] &gt; 255 
GROUP BY
    t.[name], 
    s.[name],
    i.[name],
    i.[type_desc],
    p.[rows]
ORDER BY 
    [size_mb] DESC</code></pre>
<p><iframe title="SQL Server’da Veritabanındaki En Büyük Tabloları ve Index’leri Listelemek" width="739" height="416" src="https://www.youtube.com/embed/x7WTX3s6YOM?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>Herkese çalışma hayatında ve yaşamında başarılar kolaylıklar.</p>
<div class='epvc-post-count'><span class='epvc-eye'></span>  <span class="epvc-count"> 170</span><span class='epvc-label'> Kez Okundu</span></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
