Null or empty check for a string variable
if((isnull(@value,''))='') I want to know whether the above piece of code works in checking if the variable is null or empty. Yes, that code does exactly that. You can also use: if (@value is null or @value = '') Edit: With the added information that @value is an int value, you need instead: if (@value is null) An int value can never contain the value '' . AnasChavadi Use This way is Better if LEN(ISNULL(@Value,''))=0 This check the field is empty or NULL Yes, you could also use COALESCE(@value,'')='' which is based on the ANSI SQL standard: SELECT CASE WHEN COALESCE(@value,'')='' THEN 'Yes,