Reputation: 21764
When I use Sql Server Profiler, I can see a bunch of useful performance statistics for my queries (CPU, page reads, etc). I'd like to be able to capture these when my .NET code runs queries for logging and benchmarking purposes. To best correlate between the code executing the query and the query statistics, I'd like do do this capturing from within .NET as part of query execution. Is this possible using the ADO.NET (e. g. SqlConnection) APIs? How can it be done?
Note: I know that .NET can be used to start and stop SQL traces / extended events, but I'm wondering if it's possible to get this information as part of normal query execution on a connection.
Upvotes: 0
Views: 572
Reputation: 7354
No. Running a trace
is required to get the detailed performance metrics you're seeing in SQL Server Profiler.
Upvotes: 1