OR (CONVERT(int, (@@microsoftversion / 0x1000000) & 0xff) > 13) -- SQL 2017+ OR (CONVERT(int, (@@microsoftversion / 0x1000000) & 0xff) = 13 AND CONVERT(int ...
-- Enforce that username is never NULL or blank. -- App layer already validates this, but defence-in-depth at the DB level -- prevents any direct API or future code path from writing an empty username ...