Forum Discussion
T-SQL executing directly in Eventhouse KQL Queryset without comment (--) prefix
- 8 months ago
Thank you, @ svelde for your response.
Hi Ruchi23,
We appreciate your inquiry through the Microsoft Fabric Community Forum and thank you for validating the behavior across both Fabric Eventhouse and Azure Data Explorer.
Based on my understanding, the observed behavior may be due to the query editor's language auto-detection. Modern Fabric and ADX web query editors may automatically recognize T‑SQL syntax and route the query to the T‑SQL engine even without the -- prefix. This could be an editor convenience feature, and does not represent a change to the underlying Kusto or T‑SQL language requirements.
Official Microsoft documentation continues to recommend starting T‑SQL queries with a standalone -- because it explicitly forces T‑SQL mode and avoids ambiguity. It also ensures consistent behaviour across automation, APIs, scripts and non‑UI tools. Moreover, certain advanced or mixed syntax scenarios still rely on explicit mode selection.
We hope the information above helps to resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.
Thank you, @ svelde for your response.
Hi Ruchi23,
We appreciate your inquiry through the Microsoft Fabric Community Forum and thank you for validating the behavior across both Fabric Eventhouse and Azure Data Explorer.
Based on my understanding, the observed behavior may be due to the query editor's language auto-detection. Modern Fabric and ADX web query editors may automatically recognize T‑SQL syntax and route the query to the T‑SQL engine even without the -- prefix. This could be an editor convenience feature, and does not represent a change to the underlying Kusto or T‑SQL language requirements.
Official Microsoft documentation continues to recommend starting T‑SQL queries with a standalone -- because it explicitly forces T‑SQL mode and avoids ambiguity. It also ensures consistent behaviour across automation, APIs, scripts and non‑UI tools. Moreover, certain advanced or mixed syntax scenarios still rely on explicit mode selection.
We hope the information above helps to resolve the issue. Should you have any further queries, please feel free to contact the Microsoft Fabric community.
Thank you.
- Ruchi238 months agoFrequent Visitor
Thanks for the detailed explanation.
That makes a lot of sense. So basically the web editor is doing us a favor by auto-detecting, but if I'm writing scripts or using APIs I should still use the "--"prefix to be safe.Good to know it's more of a best practice thing rather than the docs being wrong. I'll stick with adding the prefix going forward.
Appreciate the clarification!
- Ruchi238 months agoFrequent Visitor
Thanks for the detailed explanation.
That makes a lot of sense. So basically the web editor is doing us a favor by auto-detecting, but if I'm writing scripts or using APIs I should still use the "--"prefix to be safe.Good to know it's more of a best practice thing rather than the docs being wrong. I'll stick with adding the prefix going forward.
Appreciate the clarification!