Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

some Comments Break SQL DB2 queries

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:

c1.PNG

 

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.

 

c2.PNG

-------------------------------------------------

c3.jpg

 

I added a new comment today that broke the query. The first-line comment was working before:

c4.PNG

 

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.

c5.PNG

 

 

Status: Accepted
Comments
v-qiuyu-msft
Community Support

Hi @jengwt,

 

Does the issue happen to DirectQuery mode or Import mode? 

 

Please update your Power BI desktop to the latest version 2.64.5285.741 then test it again. 

 

Please record a video to show the issue, then share the video and Power BI desktop trace log with us. You can upload them to your Onedrive and send the share link to me via private message. 

 

Best Regards,
Qiuyun Yu 

jengwt
Helper V

@v-qiuyu-msft my version is actually later than that; 2.65.5313.621. That may be part of the problem. Sometimes Microsoft writes code and they don't test it.

 

I doubt I'd be able to post a video on here, but I can try.

 

How am I supposed to get a trace? Fiddler?

v-qiuyu-msft
Community Support

Hi @jengwt,

 

You can enable below option then repeat steps to reproduce the issue, then share desktop trace log: https://ruiromanoblog.wordpress.com/2016/01/08/power-bi-desktop-trace-logs-analyser/. 

 

There is a new Power BI desktop version 2.65.5313.621, you can test with this new version to see if the issue is here. 

 

Best Regards,
Qiuyun Yu 

jengwt
Helper V

@v-qiuyu-msft my PBI has updated to 2.65.5313.621, and I am still getting this error. I would like to send you diagnostic info, but I'm sure you will understand that I do not want to post proprietary information on a public forum.

v-qiuyu-msft
Community Support

Hi @jengwt,

 

Does the issue happen to DirectQuery mode or Import mode? 

 

There is a new Power BI desktop version 2.65.5313.701, you can update your Power BI desktop then test it again. 

 

You can send video and desktop trace log to my work email. I will send my work email to you via private message. 

 

Best Regards,
Qiuyun Yu 

 

 

 

 

jengwt
Helper V

@v-qiuyu-msft Thanks. I'll email you with what I get.

Let's not forget to post here what we discover.

v-qiuyu-msft
Community Support

Hi @jengwt,

 

Thank you for your detail information. I have consulted this issue internally, will keep you update once I get any information. 

 

Best Regards,
Qiuyun Yu 

v-qiuyu-msft
Community Support

Hi @jengwt,,

 

I have reported this issue internally: CRI 97039270. Will keep you update once I get any information. 

 

Best Regards,
Qiuyun Yu 

v-qiuyu-msft
Community Support
Status changed to: Accepted
 
v-yuta-msft
Community Support

@jengwt ,

 

This issue has been fixed currently.

 

Regards,

Jimmy Tao