FIX: Failed Sp_prepare Incorrectly Closes Transaction (198265)
The information in this article applies to:
This article was previously published under Q198265
BUG #: 53474 (SQLBUG_70)
SYMPTOMS
Failure to prepare a statement, either by means of ODBC or OLE DB,
incorrectly results in the failure of the entire transaction. Potential
causes for such a failure include syntax errors or incorrect object names
in the statement. Subsequent operations that depend on the transaction
being active, including attempts to commit the transaction, will fail.
CAUSE
SQL Server incorrectly closes the whole transaction after any error, rather
than stopping execution of the statement only.
WORKAROUND
To work around this problem, execute the statement without first preparing
it, using SQLExecDirect or ICommandText::Execute. An error during either of
these operations will cause only the statement, rather than the whole the
transaction, not to be processed. The application can then determine the
appropriate response, such as ignoring the error and continuing with other
statements, resubmitting the query without the problem, or rolling back the
transaction.
STATUS
Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 1 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base: 232570INF: How to Obtain Service Pack 1 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.
Modification Type: | Major | Last Reviewed: | 3/14/2006 |
---|
Keywords: | kbBug kbfix kbQFE KB198265 |
---|
|