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 Administration (2000)
 sql query to retrieve NULL values

Author  Topic 

Keshaba
Yak Posting Veteran

52 Posts

Posted - 2008-11-19 : 08:26:22
Hi
I am using Sql server 2005 Express.I want to write a query to retrieve all datas from a particular table name 'Employee_Master' whose values of a particular Column Name 'Reason' are NULL.
I am trying to write like this but it didn't help

select * from Employee_Master where Reason = NULL

Keshab

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-19 : 08:46:26
select * from Employee_Master where Reason IS NULL
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-19 : 08:47:42
equality operator wont work with NULL values as NULL is not stored as a value in table. So use IS NULL instead.
Alteratively if you want to consider NULL also as a value, you need to change ANSI NULL settings
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-19 : 09:01:19
http://doc.ddart.net/mssql/sql70/set-set_5.htm
Go to Top of Page
   

- Advertisement -