I have question related to isnull()
function vs is null
keyword in SQL Server.
I know that writing below condition in where clause of SQL statement will result in bad performance
isnull(@C_FirstName, '') <> ''
We can replace same with
(@C_FirstName IS NOT NULL AND @C_FirstName <> '')
in the where
clause
But will I get any performance gain in case of if condition?
Below is the example with two option
Option #1:
If `isnull(@C_FirstName, '') <> ''`
Option #2:
If `(@C_FirstName IS NOT NULL AND @C_FirstName <> '')`
From option 1 and option 2 which statement is recommended?