Click here to Skip to main content
15,884,629 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
if we have table A with Column Column1
i know that if we want to take the rows with null value for Column1 we
use the query
Select * From A
Where Column1 Is Null

And not the query
Select * From A
Where Column1 = NULL

but if i want to use the condition Column1= Null and want it to give the same result as Column1 Is Null
Is there any sql configurations Or Parameters that should be set to on
to make me able to use this query or there is none

What I have tried:

I have tried to put a question about using is null statement in sql server
Posted
Updated 9-Aug-16 22:51pm
Comments
Tomas Takac 9-Mar-16 4:00am    
Why? You can set SET ANSI_NULLS OFF[^] but I would advise against that.
Richard Deeming 9-Mar-16 6:52am    
You should post this as a solution. :)
oula alsheikh 9-Mar-16 8:48am    
thanks for info
CHill60 9-Mar-16 7:19am    
Why on earth do you want to say Column1 = Null ?
What are you really trying to do?
oula alsheikh 9-Mar-16 8:51am    
if we want to compare variable value with null we have to test if this variable is null first to use the is null condition in the clause
while you dont have to when using = operator in usual

1 solution

Null value in a column of a row means there is no value present for that cell.
"where column1=Null" - This condition means that there is some value which is "Null" and that value ="Null" is not present and hence no result comes.
"where column1 is Null" - In this condition, rows which does not have any value for column1 are searched and hence it fetches the result.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900