BUG: sqlcursorfetch AVs on Select w/ "Order By," No Join

Last reviewed: April 9, 1997
Article ID: Q153920
The information in this article applies to:
  • Microsoft SQL Server version 6.5

SYMPTOMS

The use of the FETCH operation on a cursor to select from multiple tables, including sysobjects table, with no join and using an "order by" clause causes a handled access violation (AV).

WORKAROUND

In most application environments, this is not a problem since the system table sysobjects is not involved in user queries. In cases where sysobjects is involved, avoid using extraneous tables in select statements, especially those involving cursor operations. It is generally a sound programming practice to include in select statements only the tables actually involved in the statement.

STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The AV happens during the FETCH operation.

The following conditions have to be true for the AV to occur:

  1. The column list selected should include at least 1 column from sysobjects
2. The table "sysobjects" should be included in the FROM clause. The other
   tables in the from clause can be system tables or user tables.
3. The query should involve an "order by" clause. 4. No join should be done. The where clause seems to be immaterial, and the
   AV occurs whether or not a where clause is involved.


Additional query words: server av terminate
Keywords : kbbug6.50
Version : 6.5
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 9, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.