I've found that when attempting to parse COALESCE and NULLIF statements that the parser ends up evaluating these to a SqlNullScalarExpression with no children. As an example, for the following query:
SELECT COALESCE((SELECT TOP 1 1 FROM MYTABLE), 2)
The parser stops at COALESCE((SELECT TOP 1 1 FROM MYTABLE), 2) as a SqlNullScalarExpression with no children. The SELECT sub-query inside of that is never parsed at all.
I've found that when attempting to parse COALESCE and NULLIF statements that the parser ends up evaluating these to a SqlNullScalarExpression with no children. As an example, for the following query:
SELECT COALESCE((SELECT TOP 1 1 FROM MYTABLE), 2)
The parser stops at COALESCE((SELECT TOP 1 1 FROM MYTABLE), 2) as a SqlNullScalarExpression with no children. The SELECT sub-query inside of that is never parsed at all.