The information in this article applies to:
SUMMARYThe usage of tempdb is affected by two changes in behavior when you upgrade from the Microsoft ODBC SQL Server driver that shipped with SQL Server version 4.21a to the one that ships with SQL Server version 6.0 or 6.5. MORE INFORMATION
You can configure the Microsoft SQL Server driver to generate stored
procedures to support the ODBC SQLPrepare statement. One of the problems
with older Microsoft ODBC SQL Server drivers was that if an ODBC client's
connection with SQL Server was broken for some reason, the ODBC driver
would not get a chance to clean-up these procedures.
The ODBC driver does use server-side cursors for all other ODBC cursor types when executing a single SELECT statement, or a stored procedure that contains only a single SELECT statement. If the SQL command being executed does not fit this profile, the driver will not use server cursors. The second change is in the driver specific SQLSetConnectOption of SQL_USE_PROCEDURE_FOR_PREPARE. The version 2.00.1912 ODBC driver had two options for this: SQL_UP_OFF, and the default of SQL_UP_ON. When SQL_UP_ON was specified, the driver would create a stored procedure when SQLPrepare was called, and then drop the stored procedure on either a SQLFreeStmt(SQL_DROP), SQLDisconnect, or on the next call to SQLPrepare. The version 2.50.0121 ODBC driver has changed so that there are now three options: SQL_UP_OFF, SQL_UP_ON, and SQL_UP_ON_DROP. In the new driver, SQL_UP_ON_DROP behaves the way SQL_UP_ON behaved in the 2.00.1912 driver. SQL_UP_ON has had its behavior changed so that it no longer drops the generated procedures on a call to SQLFreeStmt(SQL_DROP) or the next SQLPrepare, it only drops them on a call to SQLDisconnect. SQL_UP_ON remains the default for the driver. This means some long running applications which maintain one or more connections for long periods may see a buildup of temporary stored procedures in tempdb when using the 2.50.0121 driver. The applications can eliminate the problem by calling SQLSetConnectOption to set SQL_USE_PROCEDURE_FOR_PREPARE to SQL_UP_ON_DROP instead of SQL_UP_ON. This is documented in the SQL Server 6.0 ODBC Driver help file DRVSSRVR.HLP, and in the ODBC driver chapter of the SQL Server 6.0 Books Online, "ODBC SQL Server Driver." SQL_UP_ON and other options are defined in SQL Server ODBC driver help file as follows:
Additional query words: sql6
Keywords : kbinterop kbprg SSrvProg |
Last Reviewed: April 15, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |