Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
I like to comment my work, don't you? It helps the next poor sod figure out what on Earth I was doing when I wrote that query.
However, I have found that some comments break SQL DB2 statements. I played around with the query and found that the query works just fine, it is ONLY the existence of comments in two places break the query, and ONLY in PowerBI.
It makes no difference if I use single-line or multi-line comments.
When I run the query in PBI, I get the following error:
The following highllighted comments are the two instances where comments break the code. The query is a series of CTEs with a simple SELECT * at the end. NOTICE that I use the same commenting everywhere else in the query.
This leads me to beleive that PBI isn't properly reading these comments, perhaps it is extending the comment to the next line.
-------------------------------------------------
I added a new comment today that broke the query. The first-line comment was working before:
I added the following comment under it, which broke the query in PBI. Then on a hunch I just tried removing the apostrophe from the comment, and the code worked again. This is definitely a bug.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.