Prepare/Execute Statements

The driver creates temporary stored procedures (as opposed to regular stored procedures in earlier versions) on a SQLPrepare. These procedures are automatically deleted when the connection is abnormally terminated. Previously, stored procedures created on a SQLPrepare were orphaned at the server when the connection was abnormally terminated. In addition, the driver provides users with a driver-specific connection option (SQL_USE_PROCEDURE_FOR_PREPARE) that governs when these temporary stored procedures are deleted. By default, they are deleted when the connection is freed. When you are issuing several prepare/execute statements in a connection and need to conserve usage of tempDB, you can have the driver delete these procedures when an hstmt is closed.