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
 Transact-SQL (2000)
 Searching for Null

Author  Topic 

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2006-06-23 : 04:21:33
Hi i want to do a select to search for Null values is this possible ?

nr
SQLTeam MVY

12543 Posts

Posted - 2006-06-23 : 04:31:43
???
select * from tbl where fld is null



==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

rookie_sql
Constraint Violating Yak Guru

443 Posts

Posted - 2006-06-23 : 04:31:49
Its ok i got it. IS Null
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-23 : 04:46:57
Because you cant use = operator to check for NULL.

if NULL=NULL
print 'NULL=NULL'

if NULL IS NULL
print 'NULL IS NULL'


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2006-06-23 : 07:38:26
quote:
Originally posted by madhivanan

Because you cant use = operator to check for NULL.
SET ANSI_NULLS {ON | OFF}


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -