﻿<?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>Kelime Sayan Fonksiyon &#8211; SQL Server Eğitimleri</title>
	<atom:link href="https://sqlserveregitimleri.com/etiket/kelime-sayan-fonksiyon/feed" rel="self" type="application/rss+xml" />
	<link>https://sqlserveregitimleri.com</link>
	<description>SQL Server ile ilgili her şey</description>
	<lastBuildDate>Sat, 18 Sep 2021 15:56:33 +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 Kelime Sayan Fonksiyon</title>
		<link>https://sqlserveregitimleri.com/sql-serverda-kelime-sayan-fonksiyon</link>
		
		<dc:creator><![CDATA[Yavuz Selim Kart]]></dc:creator>
		<pubDate>Sat, 18 Sep 2021 15:56:33 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[Kelime Sayan Fonksiyon]]></category>
		<category><![CDATA[sql kelime sayma]]></category>
		<category><![CDATA[sql server kelime sayma]]></category>
		<guid isPermaLink="false">https://sqlserveregitimleri.com/?p=10794</guid>

					<description><![CDATA[Herkese merhaba, Bu yazıda SQL Server’da kelime sayan fonksiyon kullanımından bahsedeceğim. SQL Server&#8217;da bazı durumlarda verilen cümledeki kelime sayısını bulmak isteyebilirsiniz. Aşağıdaki fonksiyonu kullanarak bu...]]></description>
										<content:encoded><![CDATA[<p>Herkese merhaba,</p>
<p>Bu yazıda SQL Server’da kelime sayan fonksiyon kullanımından bahsedeceğim.</p>
<p>SQL Server&#8217;da bazı durumlarda verilen cümledeki kelime sayısını bulmak isteyebilirsiniz.</p>
<p>Aşağıdaki fonksiyonu kullanarak bu işlemi rahatlıkla yapabilirsiniz.</p>
<pre class="line-numbers"><code class="language-sql">CREATE FUNCTION KelimeSayaci
(
    @Cumle VARCHAR(MAX)
)
RETURNS INT
AS
BEGIN

    DECLARE @Index INT;
    DECLARE @Char CHAR(1);
    DECLARE @OncekiChar CHAR(1);
    DECLARE @KelimeSayaci INT;

    SET @Index = 1;
    SET @KelimeSayaci = 0;

    WHILE @Index &lt;= LEN(@Cumle)
    BEGIN
        SET @Char = SUBSTRING(@Cumle, @Index, 1);
        SET @OncekiChar = CASE
                              WHEN @Index = 1 THEN
                                  ' '
                              ELSE
                                  SUBSTRING(@Cumle, @Index - 1, 1)
                          END;

        IF @OncekiChar = ' '
           AND @Char != ' '
            SET @KelimeSayaci = @KelimeSayaci + 1;

        SET @Index = @Index + 1;
    END;

    RETURN @KelimeSayaci;

END;
GO

--Kulllanımı

DECLARE @TestCumle VARCHAR(4000)
SET @TestCumle = 'Yavuz Selim Kart SQL Server Eğitimleri sitesini kurmuştur ve halen yönetmektedir.'

SELECT dbo.KelimeSayaci ( @TestCumle ) AS Sayac</code></pre>
<p>Fonksiyonu oluşturup kodu çalıştırdığınızda aşağıdaki gibi bir sonuç elde edeceksiniz.</p>
<p><img fetchpriority="high" decoding="async" class="alignnone wp-image-10797 size-full" src="https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-kelime-sayan-fonksiyon-1.jpg" alt="SQL Server’da Kelime Sayan Fonksiyon" width="700" height="394" srcset="https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-kelime-sayan-fonksiyon-1.jpg 700w, https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-kelime-sayan-fonksiyon-1-315x177.jpg 315w, https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-kelime-sayan-fonksiyon-1-533x300.jpg 533w, https://sqlserveregitimleri.com/wp-content/uploads/2021/09/sql-serverda-kelime-sayan-fonksiyon-1-240x135.jpg 240w" sizes="(max-width: 700px) 100vw, 700px" /></p>
<p>Görüldüğü üzere 11 kelime olduğu görülmüş 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"> 294</span><span class='epvc-label'> Kez Okundu</span></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
