# Execute SQL queries on notebook

**URL:** <https://community.dynatrace.com/t/execute-sql-queries-on-notebook/45516>\
**Category:** Automations\
**Tags:** integrations, notebooks\
**Created:** [May 9, 2024, 7:25pm UTC](https://community.dynatrace.com/t/execute-sql-queries-on-notebook/45516 "2024-05-09T19:25:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![soportetr](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@soportetr](https://community.dynatrace.com/u/soportetr)\
**Post date:** [May 9, 2024, 7:25pm UTC](https://community.dynatrace.com/t/execute-sql-queries-on-notebook/45516/1 "2024-05-09T19:25:09Z")

</div>

Hello everyone,

Is it possible to execute SQL queries on Dynatrace notebooks using the _ **add code** _ option?

If so, does anyone have any guide or example of doing so?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![christian\_kreuz](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/christian_kreuz/32/21669_2.png) [@christian\_kreuz](https://community.dynatrace.com/u/christian_kreuz)\
**Post date:** [May 13, 2024, 7:35am UTC](https://community.dynatrace.com/t/execute-sql-queries-on-notebook/45516/2 "2024-05-13T07:35:20Z")

</div>

You could integrate with an external API via JavaScript and fetch - see [Add code to a dashboard — Dynatrace Docs](https://docs.dynatrace.com/docs/observe-and-explore/dashboards-and-notebooks/dashboards-new/components/dashboard-component-code#example-1-simple-request-and-response-to-table) for details.

---

<div class="post-metadata">

**Author:** ![soportetr](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@soportetr](https://community.dynatrace.com/u/soportetr)\
**Post date:** [May 28, 2024, 4:53pm UTC](https://community.dynatrace.com/t/execute-sql-queries-on-notebook/45516/3 "2024-05-28T16:53:09Z")

</div>

Hi [@christian\_kreuz](https://community.dynatrace.com/user/23530),

And will there be any possibility to make the connection to any database (MySql, SQL Server, Oracle…) using this option?

---

<div class="post-metadata">

**Author:** ![christian\_kreuz](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/christian_kreuz/32/21669_2.png) [@christian\_kreuz](https://community.dynatrace.com/u/christian_kreuz)\
**Post date:** [May 29, 2024, 7:44am UTC](https://community.dynatrace.com/t/execute-sql-queries-on-notebook/45516/4 "2024-05-29T07:44:23Z")

</div>

Hi!

Our supported interface is HTTP(s) calls. Direct access to Databases is only possible **only if** the database-management-system offers you a **HTTP/REST endpoint** (or if you provide such an endpoint for your database yourself).

This is not specific to Dynatrace or functions though.
