The SQL Prompt Best Practice rule checks whether a comparison or expression includes a NULL literal (‘NULL’), which in SQL Server, rather than result in an error, will simply always produce a NULL result. Phil Factor explains how to avoid this, and other SQL NULL-related calamities.
SQL Prompt has a code analysis rule (BP011) that checks whether a comparison or expression includes a NULL
literal ('NULL'
). These will always produce a NULL
result. To determine whether a datatype is or isn’t NULL
, use ISNULL
or ISNOTNULL
.