In SQL server if you have nullParam=NULL in a where clause, it always evaluates to false. This is counterintuitive and has caused me many errors. I do understa
nullParam=NULL
null is unknown in sql so we cant expect two unknowns to be same.
However you can get that behavior by setting ANSI_NULLS to Off(its On by Default) You will be able to use = operator for nulls
SET ANSI_NULLS off if null=null print 1 else print 2 set ansi_nulls on if null=null print 1 else print 2