April 27, 2012 at 12:41 pm
hi
this is just question to know.
in my cursor i am giving condition like(@maxdate =null)
it was not working
but if do (@maxdate is null)
that was working.
what is different between them.
@maxdate is datetime param
April 27, 2012 at 12:45 pm
Both are used for comparisons.
This makes no sense:
= (@maxdate = null)
And neither does what you tried to do:
like (@maxdate = null)
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 27, 2012 at 12:46 pm
You need to use IS NULL or IS NOT NULL when checking for a null value. You need to remember the null = null is NOT true. Also null <> null is NOT true.
April 27, 2012 at 12:48 pm
I guess the OP wants to know why NULL cannot be used with = operator but can be used with the keyword IS
Riya_dave, it depends on SET ANSI_NULL setting of your database
April 27, 2012 at 12:53 pm
Lynn Pettis (4/27/2012)
ColdCoffee (4/27/2012)
I guess the OP wants to know why NULL cannot be used with = operator but can be used with the keyword ISRiya_dave, it depends on this setting of your database
Not making any assumptions here.
Thats why i guessed it 😎 And OP is one confused(ing) person wrt SQL, IIRC.
April 27, 2012 at 12:54 pm
got clear now.
thanks,thats what i wanted to know
April 27, 2012 at 12:54 pm
Lynn Pettis (4/27/2012)
ColdCoffee (4/27/2012)
I guess the OP wants to know why NULL cannot be used with = operator but can be used with the keyword ISRiya_dave, it depends on this setting of your database
Not making any assumptions here.
It may be petulent, but I am just returning the favor on the answers I give to the contrived questions from this particular poster. It's as if this is someone playing a game with us.
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 27, 2012 at 12:57 pm
opc.three (4/27/2012)
Lynn Pettis (4/27/2012)
ColdCoffee (4/27/2012)
I guess the OP wants to know why NULL cannot be used with = operator but can be used with the keyword ISRiya_dave, it depends on this setting of your database
Not making any assumptions here.
It may be petulent, but I am just returning the favor on the answers I give to the contrived questions from this particular poster. It's as if this is someone playing a game with us.
Just remember, he isn't showing us actual code.
April 27, 2012 at 1:06 pm
Lynn Pettis (4/27/2012)
Just remember, he isn't showing us actual code.
He? the names sounds like a SHE :-D. Whats your take ?
{Lets, for fun, hijack this thread :-P}
April 27, 2012 at 1:10 pm
ColdCoffee (4/27/2012)
Lynn Pettis (4/27/2012)
Just remember, he isn't showing us actual code.He? the names sounds like a SHE :-D. Whats your take ?
{Lets, for fun, hijack this thread :-P}
I use the pronoun he in the generic sense (instead of he/she or s/he), until otherwise corrected. For instance, when someone refers to me in the female gender I quickly correct them as I am a male.
April 27, 2012 at 1:18 pm
Lynn Pettis (4/27/2012)
ColdCoffee (4/27/2012)
Lynn Pettis (4/27/2012)
Just remember, he isn't showing us actual code.He? the names sounds like a SHE :-D. Whats your take ?
{Lets, for fun, hijack this thread :-P}
I use the pronoun he in the generic sense (instead of he/she or s/he), until otherwise corrected. For instance, when someone refers to me in the female gender I quickly correct them as I am a male.
Totally.. I just wanted to make this thread light 😉
April 27, 2012 at 1:21 pm
...on second thought...comment removed...
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
April 27, 2012 at 1:31 pm
opc.three (4/27/2012)
...on second thought...comment removed...
Dang, had three minutes to see what you said and I missed it. 😛
April 27, 2012 at 1:36 pm
Lynn Pettis (4/27/2012)
opc.three (4/27/2012)
...on second thought...comment removed...Dang, had three minutes to see what you said and I missed it. 😛
Yeah...for once I need to stop violating my rule about posting junk late on a Friday afternoon 😀
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
Viewing 15 posts - 1 through 15 (of 25 total)
You must be logged in to reply to this topic. Login to reply