What is faster in SQL to check value for NULL or 0
I want to have the fastest way to check is value already in table.
For example which is faster :
IF ((SELECT ID FROM [SomeTable].[dbo].[BlockedSubscriberNumbers]
WHERE VALUE = @myVal) is null )
BEGIN
....
END
ELSE
BEGIN
....
END
or
IF ((SELECT ID FROM [SomeTable].[dbo].[BlockedSubscriberNumbers]
WHERE VALUE = @myVal) > 0 )
BEGIN
....
END
ELSE
BEGIN
....
END
Also does in T-SQL plays role where the frequent accruing case must be. I mean is it will be faster that in most cases it will fail into IF block and slower if it will mostly go into ELSE.