web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

How to find the user who run a query (SQL way)

(0) ShareShare
ReportReport
Posted on by 5

Hello,

Is it possible to find the user whi ran a query in D365 ? I mean in case of long queries we would like to quickly identify the query run by the final user, not the service account behind. ?

Regards

I have the same question (0)
  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi HeadQuaker,

    When you have a long running query, it would be better to find the process which is starting the process. There can be a guess based on the query statement or you can try to map activity logs from environment monitoring. Users are anonymized in the telemetry.

  • HeadQuaker Profile Picture
    5 on at

    hello

    When user has long queries, it is difficult for use to identify  anything so that's why we would like to find a way to quickly identify the query launched by that user.

    There are some points that force us to do like this :

    - the user is in a realtime production process, he can't wait for us to find a process then read logs, etc.

    - the user is not aware  and do not care how it works in the backgrounds, he juste want the query to be fast.

    Si we really have to find a way to find that query processed by that user.77Is it possible ?

  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi HeadQuaker,

    You are now looking at things started by the user Your question was about the long running query as starting point. Now you mention that a user started a process and probably will complain it is slow.

    If the user is complaining, you should know what he started. Then drill down into the coding to check what query is executed.

    When you have a long running query without moaning users, there is no direct link to the user.

  • HeadQuaker Profile Picture
    5 on at

    Hello

    Sorry now we do not know what the user is running, we do not know about the functionnal part. We (the IT) just have to find which query is slow, starting from the user.

    From AX + Oracle, it was easy to do, since we are on SQL Server, it is realy harder to quickly find the query linked to a user.

  • André Arnaud de Calavon Profile Picture
    300,911 Super User 2025 Season 2 on at

    Hi HeadQuaker,

    In previous versions of Dynamics AX (2012 and before), it was possible to have a SPID linked to the user in the AX application, but it has some performance impact. With Dynamics 365 in the cloud, I only have experience with viewing some long running queries via environment monitoring. Based on experience, I know quite often what process could be linked or which direction to search and then dive in from this point. I have not dealt with on-premise customer environments myself.

    Based on the time of the day, you can also map user activity via the environment monitoring which could give some hints which user might have started a process.

    Dealing with performance issues is different in Dynamics 365. Probably the next course can give you some more insights: Work with performance and monitoring tools in Finance and Operations apps - Learn | Microsoft Docs

    If you have a concrete example, you can also provide information here so we can check which process can be related to the query. Based on the process, you can check which users might have permissions to start it.

  • HeadQuaker Profile Picture
    5 on at

    Hello

    Thanks for the information, we have Dynamics 365 on premise not on cloud.

    We hope our dev team can make some analysis tools to give us time in issues.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 664 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 522 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 303 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans