Leí todas las respuestas aquí, y me llevó un tiempo averiguar qué estaba pasando. Lo siguiente se basa en la respuesta por Moe Sisko y alguna investigación relacionada
Si su consulta SQL no devuelve ningún dato, no hay un campo con un valor nulo, por lo que ni ISNULL ni COALESCE funcionarán como usted lo desee. Mediante el uso de una consulta secundaria, la consulta de nivel superior obtiene un campo con un valor nulo, y tanto ISNULL como COALESCE funcionarán como usted lo desee o espere.
Mi consulta
select isnull(
(select ASSIGNMENTM1.NAME
from dbo.ASSIGNMENTM1
where ASSIGNMENTM1.NAME = ?)
, 'Nothing Found') as 'ASSIGNMENTM1.NAME'
Mi consulta con los comentarios
select isnull(
--sub query either returns a value or returns nothing (no value)
(select ASSIGNMENTM1.NAME
from dbo.ASSIGNMENTM1
where ASSIGNMENTM1.NAME = ?)
--If there is a value it is displayed
--If no value, it is perceived as a field with a null value,
--so the isnull function can give the desired results
, 'Nothing Found') as 'ASSIGNMENTM1.NAME'
Actualmente, eso es lo que hago. Verifique que el recuento de registros esté vacío o no. Supuse que podrían haber sido una forma de atajar mi cheque. – Matt