This type of errors may occur with some JDBC drivers for SQL server (jTDS, Microsoft driver, etc.). Some drivers will have difficulty in parsing the query with comments. In such cases, it throws error.
As a solution, it is advised to remove the comments from the query.
Smarten - Solution Team
While rebuilding a cube with comments in the cube query is throwing the below error of ‘Incorrect syntax’. Whereas my other cubes with comments in the query are getting rebuilt properly.