What are the APIs used by SQL Profiler?
3 answers
Here the API Developers Blog is a fast C # program (should be easy to convert to C ++) that connects to SQL Server and shows the text of all starting batches in real time as requests come in to SQL Server.
eg. Snippet of code from link
Console.WriteLine("Event : " + trace["EventClass"]);
Console.WriteLine("SPID : " + trace["SPID"]);
Console.WriteLine("Login : " + trace["SessionLoginName"]);
Console.WriteLine("Object: " + trace["ObjectName"]);
Console.WriteLine("Text : " + trace["TextData"]);
As Alex said, you will need to use the TraceServer API .
+1
a source to share
This blog post describes the Trae Management Object (TMO) and how to use it.
A handy profiling tool using this TMO can be found at HERE
+1
a source to share