Describe the bug
Declare a variable to store COALESCE output. Run SELECT or SET to store the COALESCE output. The system returns error -
Incorrect syntax near 'COALESCE(NULL, 'Hello world!', 'Do not select this')'.
Unhandled expression type
To Reproduce
Query to reproduce the behavior:
DECLARE @Result VARCHAR(50);
SELECT @Result=COALESCE(NULL, 'Hello world!', 'Do not select this')
SELECT @Result
Expected behavior
The variable should get the value 'Hello world!' and should be shown in the results/output grid since we are selecting it at the end.
Environment (please complete the following information):
- SQL 4 CDS edition: XrmToolBox
- Results of
SELECT @@VERSION: Microsoft Dataverse - 9.2.25073.188
SQL 4 CDS - 10.0.0.0
Jul 22 2025 18:04:45
Copyright © 2020 - 2025 Mark Carrington
Describe the bug
Declare a variable to store COALESCE output. Run SELECT or SET to store the COALESCE output. The system returns error -
Incorrect syntax near 'COALESCE(NULL, 'Hello world!', 'Do not select this')'.
Unhandled expression type
To Reproduce
Query to reproduce the behavior:
Expected behavior
The variable should get the value 'Hello world!' and should be shown in the results/output grid since we are selecting it at the end.
Environment (please complete the following information):
SELECT @@VERSION: Microsoft Dataverse - 9.2.25073.188SQL 4 CDS - 10.0.0.0
Jul 22 2025 18:04:45
Copyright © 2020 - 2025 Mark Carrington