﻿<?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>Stored Prosedürlerin Kullandığı Tabloları Bulmak &#8211; SQL Server Eğitimleri</title>
	<atom:link href="https://sqlserveregitimleri.com/etiket/stored-prosedurlerin-kullandigi-tablolari-bulmak/feed" rel="self" type="application/rss+xml" />
	<link>https://sqlserveregitimleri.com</link>
	<description>SQL Server ile ilgili her şey</description>
	<lastBuildDate>Fri, 24 Sep 2021 06:51:49 +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 Stored Prosedürlerin Kullandığı Tabloları Bulmak</title>
		<link>https://sqlserveregitimleri.com/sql-serverda-stored-prosedurlerin-kullandigi-tablolari-bulmak</link>
		
		<dc:creator><![CDATA[Yavuz Selim Kart]]></dc:creator>
		<pubDate>Thu, 23 Sep 2021 09:10:05 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Prosedürlerin Kullandığı Tabloları Bulmak]]></category>
		<category><![CDATA[SQL Server’da Stored Prosedürler]]></category>
		<category><![CDATA[Stored Prosedürlerin Kullandığı Tabloları Bulmak]]></category>
		<guid isPermaLink="false">https://sqlserveregitimleri.com/?p=10676</guid>

					<description><![CDATA[Herkese merhaba, Bu yazıda SQL Server’da Stored prosedürlerin kullandığı tabloları nasıl bulacağımızdan bahsedeceğim. Aşağıdaki kodu kullanarak bu işlemi rahatlıkla yapabilirsiniz. DECLARE @TempTabloSP TABLE ( spAdi...]]></description>
										<content:encoded><![CDATA[<p>Herkese merhaba,</p>
<p>Bu yazıda SQL Server’da Stored prosedürlerin kullandığı tabloları nasıl bulacağımızdan bahsedeceğim.</p>
<p>Aşağıdaki kodu kullanarak bu işlemi rahatlıkla yapabilirsiniz.</p>
<pre class="line-numbers"><code class="language-sql">DECLARE @TempTabloSP TABLE
(
    spAdi VARCHAR(100),
    tabloAdi NVARCHAR(100)
);
DECLARE @spAdi AS NVARCHAR(100);
DECLARE @SP_Cursor AS CURSOR;
SET @SP_Cursor = CURSOR FOR
SELECT [name]
FROM sys.objects
WHERE type = 'P';
OPEN @SP_Cursor;
FETCH NEXT FROM @SP_Cursor
INTO @spAdi;
WHILE @@FETCH_STATUS = 0
BEGIN
    INSERT INTO @TempTabloSP
    SELECT OBJECT_NAME(referencing_id) AS referencing_entity_name,
           referenced_entity_name
    FROM sys.sql_expression_dependencies AS sed
        INNER JOIN sys.objects AS o
            ON sed.referencing_id = o.object_id
    WHERE referencing_id = OBJECT_ID(@spAdi);
    FETCH NEXT FROM @SP_Cursor
    INTO @spAdi;
END;
CLOSE @SP_Cursor;
DEALLOCATE @SP_Cursor;
SELECT *
FROM @TempTabloSP;

</code></pre>
<p>Kodu ilgili veri tabanı üzerinde çalıştırdığınızda aşağıdaki gibi bir sonuç alacaksınız.</p>
<p><img fetchpriority="high" decoding="async" class="alignnone wp-image-10678 size-full" src="https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-stored-prosedurlerin-kullandigi-tablolari-bulmak-1.jpg" alt="SQL Server’da Stored Prosedürlerin Kullandığı Tabloları Bulmak" width="700" height="604" srcset="https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-stored-prosedurlerin-kullandigi-tablolari-bulmak-1.jpg 700w, https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-stored-prosedurlerin-kullandigi-tablolari-bulmak-1-313x270.jpg 313w, https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-stored-prosedurlerin-kullandigi-tablolari-bulmak-1-348x300.jpg 348w, https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-stored-prosedurlerin-kullandigi-tablolari-bulmak-1-156x135.jpg 156w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Görüldüğü üzere tüm prosedürler için kullanılan tabloları göstermiş oldu. Dikkat edilirse <strong>CustOrderHist</strong> prosedüründe 4 tablo var.  Gerçekten de bu şekilde mi kontrol edelim.</p>
<p><img decoding="async" class="alignnone wp-image-10679 size-full" src="https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-stored-prosedurlerin-kullandigi-tablolari-bulmak-2.jpg" alt="SQL Server’da Stored Prosedürlerin Kullandığı Tabloları Bulmak" width="700" height="309" srcset="https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-stored-prosedurlerin-kullandigi-tablolari-bulmak-2.jpg 700w, https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-stored-prosedurlerin-kullandigi-tablolari-bulmak-2-315x139.jpg 315w, https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-stored-prosedurlerin-kullandigi-tablolari-bulmak-2-680x300.jpg 680w, https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-stored-prosedurlerin-kullandigi-tablolari-bulmak-2-306x135.jpg 306w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Görüldüğü üzere istediğimiz gibi tabloları elde etmiş olduk.</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"> 330</span><span class='epvc-label'> Kez Okundu</span></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
