I’m new to development. In sql I have written a stored procedure and
it is working correctly but I just wanted to make sure it is done the correct way.
Here I am using an IF statement in sp to check whether date column in a table is NULL or not:
if ((select sdate
from tbla
where id='3') = Null)
begin
some query
end
Will this work for all cases or do I need to check for ”(empty) also?
Empty and NULL are not the same thing, so you will need to check for an empty string separately. You also should use
is nullrather than= nullto check if a column is null.