I am using the following code to compare a string if it is equal to NULL in a Stored Procedure in Sql Server 2008.
IF(Name != '')
// Do some stuff
ELSE IF(Phone != '')
// Do some stuff
ELSE
// Do some other stuff
Is there any disadvantages or drawback's in using the above format of Checking a string.
I was using the below code before:
IF(Name IS NOT NULL)
// Do some stuff
ELSE IF(Phone IS NOT NULL)
// Do some stuff
ELSE
// Do some other stuff
which is not working as expected.