FIX: SELECT Statement with Two LIKE Clauses Where the Table Has a CHECK Constraint Causes AV

Article translations Article translations
Article ID: 284237 - View products that this article applies to.
This article was previously published under Q284237
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 57640 (SQLBUG_70)
Expand all | Collapse all

Symptoms

A SELECT statement may generate an access violation when all of the following conditions are true:
  • A CHECK constraint exists on one of the columns in the table, and that column is used in the query.
  • A composite nonclustered index exists on the table, and the order of the columns in the index is not the same as in the query.
  • The query has at least two LIKE clauses in the WHERE condition.

Workaround

One possible workaround is to replace a LIKE clause with an equality.

Status

Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 3 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
274799 INF: How to Obtain Service Pack 3 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0
For more information, contact your primary support provider.

More information

The following stack trace was generated in the errorlog when a query was run against SQL Server 7.0 Service Pack 2:
Stack Dump being sent to d:\MSSQL7\log\SQL00008.dmp
2001-01-04 17:07:54.07 spid9    Error: 0, Severity: 19, State: 0
2001-01-04 17:07:54.07 spid9    SqlDumpExceptionHandler: Process 9 generated fatal exception c0000005 
                                EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.
---------------------------------------------------------------------------------------------------
Short Stack Dump
0x0043d475 Module(sqlservr+3d475) (CConvertCtx::CConvertCtx+29)
0x004442da Module(sqlservr+442da) (CConvertCtx::PqteConvertNewChild+1f)
0x004679bf Module(sqlservr+679bf) (CCnjInfo::PriGetSingleInterval+145)
0x0046760b Module(sqlservr+6760b) (CCnjInfo::DrgpriStaticIntervals+28f)
0x00466ea2 Module(sqlservr+66ea2) (CPhyOp_Range::PqteConvert+3a0)
0x0043d4f1 Module(sqlservr+3d4f1) (COptExpr::PqteConvert+53)
0x00454b8f Module(sqlservr+54b8f) (CConvertCtx::PqteConvertChild+2c)
0x00487674 Module(sqlservr+87674) (CPhyOp_Filter::PqteConvert+5bf)
0x0043d4f1 Module(sqlservr+3d4f1) (COptExpr::PqteConvert+53)
0x00454b8f Module(sqlservr+54b8f) (CConvertCtx::PqteConvertChild+2c)
0x004991dd Module(sqlservr+991dd) (CPhyOp_Fetch::PqteConvert+42)
0x0043d4f1 Module(sqlservr+3d4f1) (COptExpr::PqteConvert+53)
0x00454b8f Module(sqlservr+54b8f) (CConvertCtx::PqteConvertChild+2c)
0x00487674 Module(sqlservr+87674) (CPhyOp_Filter::PqteConvert+5bf)
0x0043d4f1 Module(sqlservr+3d4f1) (COptExpr::PqteConvert+53)
0x00454b8f Module(sqlservr+54b8f) (CConvertCtx::PqteConvertChild+2c)
0x0045d948 Module(sqlservr+5d948) (CPhyOp_ComputeScalar::PqteConvert+39)
0x0043d4f1 Module(sqlservr+3d4f1) (COptExpr::PqteConvert+53)
0x0043d3cc Module(sqlservr+3d3cc) (COptExpr::PqteConvertTree+4c)
0x0044b7d5 Module(sqlservr+4b7d5) (COptContext::PcxteOptimizeQuery+b2b)
0x0044afe4 Module(sqlservr+4afe4) (CQuery::Optimize+206)
0x0044ab70 Module(sqlservr+4ab70) (CQuery::Prepare+91)
				

Properties

Article ID: 284237 - Last Review: November 2, 2013 - Revision: 3.0
Applies to
  • Microsoft SQL Server 7.0 Standard Edition
Keywords: 
kbnosurvey kbarchive kbbug kbfix KB284237

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com