When I try to run a SQL query and there’s no data to return, it returns an empty array. When I try to run an if and enter the data to validate, like {{Object.keys($items()[0].json).length === 0}}, it doesn’t work; the node closes.
I would make sure the SQL Server node settings are set to Always Output Data and change the IF node to check if an item exists / does not exist in the JSON from the SQL node. For example: