Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL 2k ntext field

Author  Topic 

wangyc77
Yak Posting Veteran

65 Posts

Posted - 2007-02-13 : 07:25:34
I have a field of type [ntext] and I tried the following SQL to disply rows that are not empty(they are either empty or Null field)

TABLE sid int, Etinfo ntext

select sid, Etinfo from jhdata where Etinfo IS NOT NULL
==>Doesnt work, empty field rows still show up
select Etinfo from jhdata where Etinfo <>''
==>ERROR Occurs
select Etinfo from jhdata where LEN(Etinfo )>0
==>ERROR Occurs

Please advise how to display rows whose Etinfo is empty or NULL in SQL 2k



**Jonathan**

khalik
Constraint Violating Yak Guru

443 Posts

Posted - 2007-02-13 : 07:49:28
select sid, Etinfo from jhdata where cast(Etinfo as varchar(10)) IS NOT NULL

======================================
Ask to your self before u ask someone
Go to Top of Page

wangyc77
Yak Posting Veteran

65 Posts

Posted - 2007-02-14 : 02:00:27
Thanks a lot duke

**Jonathan**
Go to Top of Page
   

- Advertisement -