﻿<?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>Tablolara Bağlı Indexleri Listeleme &#8211; SQL Server Eğitimleri</title>
	<atom:link href="https://sqlserveregitimleri.com/etiket/tablolara-bagli-indexleri-listeleme/feed" rel="self" type="application/rss+xml" />
	<link>https://sqlserveregitimleri.com</link>
	<description>SQL Server ile ilgili her şey</description>
	<lastBuildDate>Mon, 13 Jun 2022 20:15:56 +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 Tablolara Bağlı Indexleri Listeleme</title>
		<link>https://sqlserveregitimleri.com/sql-serverda-tablolara-bagli-indexleri-listeleme</link>
		
		<dc:creator><![CDATA[Yavuz Selim Kart]]></dc:creator>
		<pubDate>Fri, 08 Apr 2022 18:54:49 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server'da Tablolara Bağlı Indexler]]></category>
		<category><![CDATA[Tablolara Bağlı Indexler]]></category>
		<category><![CDATA[Tablolara Bağlı Indexleri Listeleme]]></category>
		<guid isPermaLink="false">https://sqlserveregitimleri.com/?p=13504</guid>

					<description><![CDATA[Herkese merhaba, Bu yazıda SQL Server&#8217;da tablolara bağlı indexleri listelemeyle ilgili bilgi vermeye çalışacağım. SQL Server&#8217;da bazı durumlarda tablolara bağlı indexleri listelemek isteyebilirsiniz. Aşağıdaki kodu...]]></description>
										<content:encoded><![CDATA[<p>Herkese merhaba,</p>
<p>Bu yazıda SQL Server&#8217;da tablolara bağlı indexleri listelemeyle ilgili bilgi vermeye çalışacağım.</p>
<p>SQL Server&#8217;da bazı durumlarda tablolara bağlı indexleri listelemek isteyebilirsiniz.</p>
<p>Aşağıdaki kodu kullanarak siz de bu işlemi rahatlıkla yapabilirsiniz.</p>
<pre class="line-numbers"><code class="language-sql">SELECT QUOTENAME(t.name) AS [Tablo Adı],
       QUOTENAME(i.name) AS [Index Adı],
       i.is_primary_key AS [Otomatik Artanmı],
       STUFF(REPLACE(REPLACE(
                     (
                         SELECT QUOTENAME(c.name) + CASE
                                                        WHEN ic.is_descending_key = 1 THEN
                                                            ' DESC'
                                                        ELSE
                                                            ''
                                                    END AS [data()]
                         FROM sys.index_columns AS ic
                             INNER JOIN sys.columns AS c
                                 ON ic.object_id = c.object_id
                                    AND ic.column_id = c.column_id
                         WHERE ic.object_id = i.object_id
                               AND ic.index_id = i.index_id
                               AND ic.is_included_column = 0
                         ORDER BY ic.key_ordinal
                         FOR XML PATH
                     ),
                     '&lt;row&gt;',
                     ', '
                            ),
                     '&lt;/row&gt;',
                     ''
                    ),
             1,
             2,
             ''
            ) AS [Index Alan Bilgileri],
       STUFF(REPLACE(REPLACE(
                     (
                         SELECT QUOTENAME(c.name) AS [data()]
                         FROM sys.index_columns AS ic
                             INNER JOIN sys.columns AS c
                                 ON ic.object_id = c.object_id
                                    AND ic.column_id = c.column_id
                         WHERE ic.object_id = i.object_id
                               AND ic.index_id = i.index_id
                               AND ic.is_included_column = 1
                         ORDER BY ic.index_column_id
                         FOR XML PATH
                     ),
                     '&lt;row&gt;',
                     ', '
                            ),
                     '&lt;/row&gt;',
                     ''
                    ),
             1,
             2,
             ''
            ) AS [Index Include Bilgileri]
FROM sys.tables AS t
    INNER JOIN sys.indexes AS i
        ON t.object_id = i.object_id
    LEFT JOIN sys.dm_db_index_usage_stats AS u
        ON i.object_id = u.object_id
           AND i.index_id = u.index_id
WHERE t.is_ms_shipped = 0
      AND t.name LIKE '%'
      AND i.type &lt;&gt; 0
ORDER BY i.name;</code></pre>
<p>Yukarıdaki kod bloğunu çalıştırdığınızda aşağıdaki sonucu göreceksiniz.</p>
<p><img fetchpriority="high" decoding="async" class="alignnone wp-image-13516 size-full" src="https://sqlserveregitimleri.com/wp-content/uploads/2022/04/sql-serverda-tablolara-bagli-indexleri-listeleme-1.jpg" alt="SQL Server'da Tablolara Bağlı Indexleri Listeleme" width="700" height="483" srcset="https://sqlserveregitimleri.com/wp-content/uploads/2022/04/sql-serverda-tablolara-bagli-indexleri-listeleme-1.jpg 700w, https://sqlserveregitimleri.com/wp-content/uploads/2022/04/sql-serverda-tablolara-bagli-indexleri-listeleme-1-315x217.jpg 315w, https://sqlserveregitimleri.com/wp-content/uploads/2022/04/sql-serverda-tablolara-bagli-indexleri-listeleme-1-435x300.jpg 435w, https://sqlserveregitimleri.com/wp-content/uploads/2022/04/sql-serverda-tablolara-bagli-indexleri-listeleme-1-196x135.jpg 196w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Görüldüğü üzere tablolara bağlı indexler listelenmiş oldu.</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"> 587</span><span class='epvc-label'> Kez Okundu</span></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
