Dec 3, 2012

Using equal operator in transact-SQL for ntext datatype column

12/03/2012 08:29:00 PM






Using equal operator in transact-SQL for ntext datatype column

 


use northwind

create table Test1(id int,mytext NText)

SELECT  * FROM Test1 WHERE mytext='Anytext'

Error Message :

Msg 402, Level 16, State 1, Line 1
The data types ntext and varchar are incompatible in the equal to operator.


SELECT  * FROM Test1 WHERE CONVERT(NVARCHAR(MAX), MyText) = N'AnyText'

Result:
Id Mynext

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comments:

Post a Comment

Recent Posts
Popular Articles

 

© 2013 MUNISH ORACLE DBA& .Net Developer. All rights resevered. Designed by Templateism

Back To Top