Hi @Bob sql ,
You should try to use DMV(Dynamic Management Views), and retrieve from sys.dm_exec_query_stats view, it can return aggregate performance statistics(CPU time, Physical/Logical reads etc…) for each query plans in SQL Server, you also can use Data Collection, and create a custom collection set that gather snapshots from any DMVs and upload them to a performance data warehouse
If you want to trace or record excessively long time running queries, then you can consider use an SQL Server profiler to create a trace
It is recommended that 'server side' trace are used in a production environment, Profiler will allow you to export the SQL statements to create the same thing server-side
https://serverfault.com/questions/72118/create-an-sql-trace-without-using-sql-profiler
-------------
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.