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

0 comments:
Post a Comment