Home > Software design >  Can anyone explain this if condition in SQL Server?
Can anyone explain this if condition in SQL Server?

Time:11-18

IF(ISNULL(@ApproachId, 0) = 0)

Please explain this expression - what is the meaning of this if condition and what result would it return?

CodePudding user response:

It's semantically the same as

IF(@Approachid IS NULL OR @ApproachId = 0)

It's just harder to read. :-)

CodePudding user response:

This condition checks whether "@ApproachId" is equal to zero or not. In case "@ApproachId" is a null value then it will be considered as zero.

  • Related