How can I check if a field of type ntext is null or empty in where
?
I have the following select
SELECT Subject, Notes from DocumentNotes
where Notes is null or Notes = ' '
but when compared it returns the following error:
Message 402, Level 16, State 1, Line 3 The ntext and varchar data types are incompatible in the equal to operator.
Example:
declare @textos table
(
Subject int,
Notes ntext
)
insert into @textos values
(1, ' '),
(2, ''),
(3, 'teste')
I want only the Subject ; 3