On sqlserver 2019 server,How do I write sql statement to query all operations on the server with the following fields?

heling song 61 Reputation points
2021-06-01T01:40:52.197+00:00

On sqlserver 2019 server,How do I write sql statement to query all operations on the server with the following fields?101214-qzdiwj8bvsc2ki49lebl.png

Developer technologies | Transact-SQL
Developer technologies | Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
SQL Server | Other
{count} votes

Answer accepted by question author
  1. CathyJi-MSFT 22,401 Reputation points Microsoft External Staff
    2021-06-01T02:14:31.153+00:00

    Hi @heling song ,

    > How do I write sql statement to query all operations on the server with the following fields?

    SQL server statement query could not meet your requirement. But you can using ApexSQL Log( a well known third party tool) to achieve this goal. Below is using ApexSQL tool read the SQL server transaction log in my environment.

    101205-picture2.jpg

    You can download this tool from this link.

    Below screenshot is also a Example for this tool.

    101130-screenshot-2021-06-01-101748.jpg


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Olaf Helper 47,581 Reputation points
    2021-06-02T06:48:54.877+00:00

    If you mean all currently running operation, they can be queried with

    select pro.cmd, pro.*
    from sys.sysprocesses as pro
    where pro.status = 'runnable'
    
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.