# Display generated SQL query

**URL:** <https://community.grafana.com/t/display-generated-sql-query/35156>\
**Category:** Grafana\
**Created:** [August 14, 2020, 4:41pm UTC](https://community.grafana.com/t/display-generated-sql-query/35156 "2020-08-14T16:41:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![djosephsen](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/djosephsen/32/12365_2.png) [@djosephsen](https://community.grafana.com/u/djosephsen)\
**Post date:** [August 14, 2020, 4:41pm UTC](https://community.grafana.com/t/display-generated-sql-query/35156/1 "2020-08-14T16:41:34Z")

</div>

I am using the query editor with bq back-end in “edit mode”. the documentation [https://grafana.com/docs/grafana/latest/features/datasources/mssql/](https://grafana.com/docs/grafana/latest/features/datasources/mssql/). mentions a “generated sql” button I can use to inspect the query sent to the back-end with all macros and variables resolved by grafana. The documentation on the bq plugin [https://github.com/doitintl/bigquery-grafana](https://github.com/doitintl/bigquery-grafana) also mentions you can see the “clean query” via the query analyizer’s “query” button.

In grafana 6.7.4, neither of these statements is true. Is there a way to see the generated SQL query from editor mode in grafana 6.7.4?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![djosephsen](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/djosephsen/32/12365_2.png) [@djosephsen](https://community.grafana.com/u/djosephsen)\
**Post date:** [August 17, 2020, 6:28pm UTC](https://community.grafana.com/t/display-generated-sql-query/35156/2 "2020-08-17T18:28:22Z")

</div>

Answering my own question, Grafana logs the generated SQL query to the browser console log, so you can catch it there.

---

<div class="post-metadata">

**Author:** ![chitwanmalhotra](https://avatars.discourse-cdn.com/v4/letter/c/5e9695/32.png) [@chitwanmalhotra](https://community.grafana.com/u/chitwanmalhotra)\
**Post date:** [July 6, 2024, 1:43am UTC](https://community.grafana.com/t/display-generated-sql-query/35156/3 "2024-07-06T01:43:39Z")

</div>

You can use the Query Inspector

> **[Query management | Grafana documentation](https://grafana.com/docs/grafana/latest/explore/query-management/#query-management-in-explore)**
>
> Query management in Explore To help with debugging queries, Explore allows you to investigate query requests and responses, as well as query statistics, via the Query inspector. This functionality is similar to the panel inspector tasks Inspect query...

---

<div class="post-metadata">

**Author:** ![yosiasz](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/yosiasz/32/45847_2.png) [@yosiasz](https://community.grafana.com/u/yosiasz)\
**Post date:** [July 6, 2024, 12:06pm UTC](https://community.grafana.com/t/display-generated-sql-query/35156/4 "2024-07-06T12:06:56Z")

</div>

Closed on July 6, 2024, 12:06pm UTC


