SSAS Data Source View Named Query breaks with -- comments
Using the SSAS project designer in visual studio one can create and edit named queries within a Data Source View.
Within the editor, one can paste formatted SQL, including -- comments (end of line comments), these queries are accepted, and test as valid from within the designer.
When SSAS executes the query, however, the text is reformatted, not honoring the original line breaks, so the -- comment now takes all of the rest of the SQL query, resulting in processing errors, or worse, possibly NOT resulting in processing errors, just wrong data, depending on where the comment appeared in the source text.
Upvotes: 1<=-=Aug 9 2017 5:02PM=-=>
Note that the designer correctly stores the newlines from the original SQL text in the horrible attribute format that’s used in the DSV. It’s SSAS that’s throwing them away when it wraps the DSV query in its own wrapper query.