Run T-SQL in a KQL database only by prefixing the query with a -- comment line
Short answer
B No. T-SQL in a KQL database must begin with a '--' comment line; without it the query is treated as KQL and does not run as intended.
Question

Key Takeaways
A T-SQL query inside a KQL database is only executed as T-SQL when prefixed with a '--' line; omitting it causes the query to be parsed as KQL and not meet the goal.
In a Microsoft Fabric KQL database, a query is interpreted as KQL by default. To run it as T-SQL you must begin the query with an empty T-SQL comment line (--), which tells the editor to interpret the following statements as T-SQL; without that prefix the code is treated as KQL and fails.
Common mistake: Writing valid T-SQL but forgetting the leading '--' comment line, so the KQL database interprets it as KQL syntax and the query does not run as intended.
Expert Analysis
Why the Answer Is Correct
The scenario requires the transformation to run as T-SQL against the KQL database. Fabric documentation states that to run a T-SQL query you must begin with an empty T-SQL comment line (--), which tells the query editor to interpret the following query as T-SQL rather than KQL. The proposed solution (presented as an image) lacked that prefix, so the code would be parsed as KQL and would not execute as T-SQL, failing to meet the goal. Hence the answer is No.
Why the Other Options Are Wrong
Option A (Yes) would only be correct if the solution started with the '--' T-SQL prefix; without it the KQL database does not run the statement as T-SQL.
Community Comment Notes
Community voting favors No (52 vs 48). Comments (JensQ, fassil, Zoran_S) explicitly cite the requirement to preface T-SQL with a '--' line in a KQL database. As with the sibling question, the solution code was provided as an image in the source item, so the determination relies on the documented '--' prefix rule combined with community consensus.
Official Reference
https://learn.microsoft.com/en-us/kusto/query/t-sql?view=microsoft-fabric
This link opens the official vendor documentation in a new tab.
Community Votes
52% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 8 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 8
-
Mourya959595 👍 11 Answered ASQL By default shows ASC order
-
fassil 👍 3 Answered BTo run a T-SQL query, you need to begin the query with an empty T-SQL comment line (--). This tells the query editor to interpret the following query as T-SQL and not KQL
-
Bharat 👍 3 Answered Bthe answer is correct since there is no mention of 'Enable SQL Endpoint'. If it is enabled then the correct answer would have been A
-
JensQ 👍 3 Answered BYou need to use "--" to tell the KQL DB to read code as SQL. Otherwise it tries to read it as KQL
-
Sher_Lock_Alexa 👍 3 Answered Asql ASC is the default sort order
Show 3 more comments
-
Zoran_S 👍 2 Answered B"Remember to preface T-SQL queries with a T-SQL comment line, --, to tell the query editor to interpret the following query as T-SQL and not KQL." While the code syntax is correct it is missing the '--' in the beginning to tell KQL to run it as T-SQL. Therefor it should be incorrect
-
JensQ 👍 2 Answered B"To run a T-SQL query, begin the query with an empty T-SQL comment line: --. The -- syntax tells the query editor to interpret the following query as T-SQL and not KQL." https://learn.microsoft.com/en-us/kusto/query/t-sql?view=microsoft-fabric#query-with-t-sql
-
kostadiv 👍 2 Answered Bmissing "--" in the beginning
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.