Microsoft KB Archive/138595

From BetaArchive Wiki

FIX: SELECT on Tables With Indexes Can Cause Access Violation in Update Stats

Q138595



The information in this article applies to:


  • Microsoft SQL Server version 6.0



BUG# NT: 11410 (6.0)


SYMPTOMS

A simple SELECT statement with a subquery containing an OR clause can cause a thread-level access violation. The data can be bulk-copied into the tables and the query run successfully; once the statistics for the tables are updated, however, a Db-library error is produced for each execution of the query.



CAUSE

The following conditions must be met for the access violation to occur:


  1. A SELECT statement with a subquery that has an OR clause.
  2. An index defined on each of the columns qualified by the OR clause. (They can be any type of indexes or any combination of types.)
  3. An update of the statistics is done prior to running the query.



RESOLUTION

Drop the indexes on the columns that are qualified by the OR clause. If you must have the indexes, you can have an index (clustered, simple, or non-clustered) on any one of the columns qualified in the OR clause in the query. Having indexes on both columns, however, results in the access violation.



STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.0. This problem was corrected in Service Pack 2 for SQL Server version 6.0. For more information, contact your primary support provider.

Additional query words: sql6 windows nt transact q_beforeaft

Keywords : kbprogramming
Issue type : kbbug
Technology : kbSQLServSearch kbAudDeveloper kbSQLServ600


Last Reviewed: February 23, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.