INF: SET STATISTICS and the Microsoft SQL Server ODBC DriverID: Q145645
|
This article discusses how the Microsoft SQL Server ODBC Driver returns SET STATISTICS IO and SET STATISTICS TIME data to an application.
The Transact-SQL commands SET STATISTICS IO and SET STATISTICS TIME can be
used to obtain information about the performance of SQL statements. When
these options are turned on in an ODBC environment:
SQLExecDirect(hstmt, "SET STATISTICS IO ON", SQL_NTS);
or
SQLExecDirect(hstmt, "SET STATISTICS TIME ON", SQL_NTS);
szSqlState="01000", *pfNativeError= 3613,
szErrorMsg="[Microsoft][ODBC SQL Server Driver][SQL Server]
SQL Server Parse and Compile Time: cpu time = 0 ms."
szSqlState="01000", *pfNativeError= 3615,
szErrorMsg="[Microsoft][ODBC SQL Server Driver][SQL Server]
Table: testshow scan count 1, logical reads: 1,
physical reads: 0."
Additional query words: odbc sql6 debug
Keywords : kbprg SSrvProg
Version : 6.0 6.5
Platform : WINDOWS
Issue type : kbhowto
Last Reviewed: March 24, 1999