I have an instance of SQL Server that I am trying to benchmark. From the SQL Studio application I can type
SET STATISTICS TIME ON
and see outputted statistics after that. From C++ code, I can do something like
SQLExecDirect(hstmt, "SET STATISTICS TIME ON", SQL_NTS);
and then retrieve these statistics via SQLError.
Is there a way to get at these statistics when accessing SQL Server over vanilla ODBC. In this case I am using Ruby's DBI:ODBC connector which works fine to connect and run queries but I haven't been able to figure out this meta stuff.
Well, it's not going via odbc, but if you have the Sql Server tools, would the Sql Profiler work for you? You can use that to time the execution of statements, transactions, sprocs, and a myriad other things in Sql Server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With