# Seeing Database Queries

**URL:** <https://community.dynatrace.com/t/seeing-database-queries/45633>\
**Category:** Dynatrace API\
**Tags:** databases, dynatrace-managed, dynatrace-api\
**Created:** [May 16, 2024, 7:21pm UTC](https://community.dynatrace.com/t/seeing-database-queries/45633 "2024-05-16T19:21:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kasdev](https://avatars.discourse-cdn.com/v4/letter/k/dc4da7/32.png) [@kasdev](https://community.dynatrace.com/u/kasdev)\
**Post date:** [May 16, 2024, 7:21pm UTC](https://community.dynatrace.com/t/seeing-database-queries/45633/1 "2024-05-16T19:21:58Z")

</div>

Hello. I want to see database queries via api but i dont know how to achieve it or if its possible. Anyone has an idea?

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [May 17, 2024, 4:29pm UTC](https://community.dynatrace.com/t/seeing-database-queries/45633/2 "2024-05-17T16:29:25Z")

</div>

Hi,

I think that is not possible.

Best regards

---

<div class="post-metadata">

**Author:** ![Yosi\_Neuman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/yosi_neuman/32/9845_2.png) [@Yosi\_Neuman](https://community.dynatrace.com/u/Yosi_Neuman)\
**Post date:** [May 19, 2024, 3:04pm UTC](https://community.dynatrace.com/t/seeing-database-queries/45633/3 "2024-05-19T15:04:47Z")

</div>

Hi&nbsp;[@kasdev](https://community.dynatrace.com/user/72156)

To see the DB statements you need to utilize entities rest api few times,

First with&nbsp;_ **service method group** &nbsp;_

For example we can filter the database service to show statements under SQL Queries or Procedures

Then we can pull the&nbsp;_ **service method group** &nbsp;_ from the URL

 ![Yosi_Neuman_1-1716130026303.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/e/8e978ef5170f48f3c66a61645c2c74ab745f45ab.png)

and use it as the entity ID for&nbsp;entities rest api

 ![Yosi_Neuman_5-1716130923234.png](https://global.discourse-cdn.com/dynatrace/original/3X/e/4/e4b7731bba64c52f560c9776ced2ea53282f93dc.png)

The DB statements are under&nbsp;_ **isServiceMethodOf** _

the id’s are again the ID’s for&nbsp;entities rest api

 ![Yosi_Neuman_4-1716130775232.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/e/aeb51c3f421939e1a16a43a859eb197e0674cf8d.png)

Under detected name you will find the DB statement as shown in the UI

 ![Yosi_Neuman_6-1716131014710.png](https://global.discourse-cdn.com/dynatrace/original/3X/f/0/f0840c30f51efadfeab1926a302ef9456404271b.png)

HTH

Yos
