﻿<?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>SQL Server’da The Data Types Ntext and Varchar Are Incompatible in The Equal to Operator &#8211; SQL Server Eğitimleri</title>
	<atom:link href="https://sqlserveregitimleri.com/etiket/sql-serverda-the-data-types-ntext-and-varchar-are-incompatible-in-the-equal-to-operator/feed" rel="self" type="application/rss+xml" />
	<link>https://sqlserveregitimleri.com</link>
	<description>SQL Server ile ilgili her şey</description>
	<lastBuildDate>Sat, 17 Feb 2018 11:34: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’da The Data Types Ntext and Varchar Are Incompatible in The Equal to Operator Hatası</title>
		<link>https://sqlserveregitimleri.com/sql-serverda-the-data-types-ntext-and-varchar-are-incompatible-in-the-equal-to-operator-hatasi</link>
		
		<dc:creator><![CDATA[Yavuz Selim Kart]]></dc:creator>
		<pubDate>Sat, 17 Feb 2018 11:34:56 +0000</pubDate>
				<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SQL Server’da The Data Types Ntext and Varchar Are Incompatible in The Equal to Operator]]></category>
		<category><![CDATA[SQL Server’da The Data Types Ntext and Varchar Are Incompatible in The Equal to Operator Hatası]]></category>
		<category><![CDATA[The Data Types Ntext and Varchar Are Incompatible in The Equal to Operator Hatası]]></category>
		<guid isPermaLink="false">http://sqlserveregitimleri.com/?p=4535</guid>

					<description><![CDATA[Herkese merhaba, Bu yazıda sizlere SQL Server’da the data types ntext and varchar are incompatible in the equal to operator hatasından bahsedeceğim. Bu hata NText veri tipi...]]></description>
										<content:encoded><![CDATA[<p>Herkese merhaba,</p>
<p>Bu yazıda sizlere SQL Server’da the data types ntext and varchar are incompatible in the equal to operator hatasından bahsedeceğim.</p>
<p>Bu hata NText veri tipi ile oluşturulmuş alanlarda where şartının eşittir operatörü ile kullanılarak arama yapılması sırasında ortaya çıkan bir hatadır. Konu ile ilgili örneği aşağıda görmektesiniz.</p>
<pre class="lang:default decode:true ">--Database oluşturma
CREATE DATABASE Ornek
GO

--Database seçilmesi
USE  Ornek
GO

--Tablo oluşturulması
CREATE TABLE TestTablo (Yazim NTEXT)
GO

--Tabloya veri aktarımı
INSERT INTO dbo.TestTablo
        ( Yazim )
VALUES  ( 'Yavuz Selim Kart SQL Server'  -- Yazim - ntext
          )

--Hatalı sorgu
SELECT * FROM dbo.TestTablo WHERE Yazim='Yavuz Selim Kart SQL Server'

--Hatalı sorgunun çözümü
SELECT Yazim
FROM TestTablo
WHERE CONVERT(NVARCHAR(MAX), Yazim) = N'Yavuz Selim Kart SQL Server'
</pre>
<p>Burada where şartı ile arama işlemi yapınca hata aldık. Ntext veri tipinde böyle bir hata alınıyor. Hatayı veri tipini Nvarchar(max)&#8217;a çevirerek çözdük. Ya da tablomuzdaki bu alanın veri tipini değiştirerek de çözebiliriz.</p>
<pre class="lang:default decode:true ">ALTER TABLE TestTablo
ALTER COLUMN Yazim NVARCHAR(MAX)
GO
--Bu şekilde doğru çalışmış oldu.
SELECT * FROM dbo.TestTablo WHERE Yazim='Yavuz Selim Kart SQL Server'
</pre>
<p>Ya da aşağıdaki gibi Like Operatörünü kullanarak da bu hatayı çözebiliriz.</p>
<pre class="lang:default decode:true ">SELECT *
FROM TestTablo
WHERE Yazim LIKE 'Yavuz Selim Kart SQL Server'
GO
</pre>
<p>Bu şekilde çözümleri mevcuttur.</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"> 1.158</span><span class='epvc-label'> Kez Okundu</span></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
