﻿<?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>Split Fonksiyonu &#8211; SQL Server Eğitimleri</title>
	<atom:link href="https://sqlserveregitimleri.com/etiket/split-fonksiyonu/feed" rel="self" type="application/rss+xml" />
	<link>https://sqlserveregitimleri.com</link>
	<description>SQL Server ile ilgili her şey</description>
	<lastBuildDate>Sat, 24 Sep 2022 19:56:53 +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 Split Fonksiyonu</title>
		<link>https://sqlserveregitimleri.com/sql-serverda-split-fonksiyonu</link>
		
		<dc:creator><![CDATA[Yavuz Selim Kart]]></dc:creator>
		<pubDate>Sat, 24 Sep 2022 19:56:53 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Split Fonksiyonu]]></category>
		<category><![CDATA[SQL Server'da Split]]></category>
		<category><![CDATA[SQL Server'da Split Fonksiyonu]]></category>
		<guid isPermaLink="false">https://sqlserveregitimleri.com/?p=14328</guid>

					<description><![CDATA[Herkese merhaba, Bu yazıda SQL Server’da Split fonksiyonu ile ilgili bilgi vermeye çalışacağım. SQL Server’da bazı durumlarda elinizde bulunan virgüllü dizeleri Id&#8217;li şekilde ayırarak tablo...]]></description>
										<content:encoded><![CDATA[<p>Herkese merhaba,</p>
<p>Bu yazıda SQL Server’da Split fonksiyonu ile ilgili bilgi vermeye çalışacağım.</p>
<p>SQL Server’da bazı durumlarda elinizde bulunan virgüllü dizeleri Id&#8217;li şekilde ayırarak tablo şeklinde göstermek 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">CREATE FUNCTION fn_Split
(
    @delimited NVARCHAR(MAX),
    @delimiter NVARCHAR(100)
)
RETURNS @t TABLE
(
    Id INT IDENTITY(1, 1),
    Val NVARCHAR(MAX)
)
AS
BEGIN
    DECLARE @xml XML;
    SET @xml = N'&lt;root&gt;&lt;r&gt;' + REPLACE(@delimited, @delimiter, '&lt;/r&gt;&lt;r&gt;') + '&lt;/r&gt;&lt;/root&gt;';

    INSERT INTO @t
    (
        Val
    )
    SELECT r.value('.', 'varchar(max)') AS item
    FROM @xml.nodes('//root/r') AS records(r);

    RETURN;
END;
GO

--Kullanımı

SELECT * FROM dbo.fn_Split('2,3,6,5,8,9,99',',')</code></pre>
<p>Yukarıdaki kodu çalıştırınca aşağıdakine benzer bir sonuç göreceksiniz.</p>
<p><img fetchpriority="high" decoding="async" class="alignnone wp-image-14330 size-full" src="https://sqlserveregitimleri.com/wp-content/uploads/2022/09/sql-serverda-split-fonksiyonu-1.jpg" alt="SQL Server'da Split Fonksiyonu" width="700" height="492" srcset="https://sqlserveregitimleri.com/wp-content/uploads/2022/09/sql-serverda-split-fonksiyonu-1.jpg 700w, https://sqlserveregitimleri.com/wp-content/uploads/2022/09/sql-serverda-split-fonksiyonu-1-315x221.jpg 315w, https://sqlserveregitimleri.com/wp-content/uploads/2022/09/sql-serverda-split-fonksiyonu-1-427x300.jpg 427w, https://sqlserveregitimleri.com/wp-content/uploads/2022/09/sql-serverda-split-fonksiyonu-1-192x135.jpg 192w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Görüldüğü üzere elimizde bulunan virgüllü dizeleri Id&#8217;li şekilde ayırmış 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"> 323</span><span class='epvc-label'> Kez Okundu</span></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
