DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 295114 - Last Review: November 17, 2004 - Revision: 4.2

This article was previously published under Q295114
BUG #: 235696 (SHILOH_bugs)

On This Page

SYMPTOMS

Executing a SELECT * FROM SYSINDEXES query against a database that has been upgraded from Microsoft SQL Server 7.0 may cause an Access Violation. If an Access Violation occurs, an error message similar to the following displays in the query window:
ODBC: Msg 0, Level 19, State 1
SqlDumpExceptionHandler: Process 51 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process.

Server: Msg 1203, Level 20, State 1, Line 1
Process ID 51 attempting to unlock unowned resource KEY: 7:2:1 (790023da5d09).

CAUSE

The maximum length defined for the keys column in the sysindexes system table in SQL Server 2000 is 1088, while in SQL Server 7.0, it is only 816. When a database is upgraded from SQL Server 7.0, the maximum length defined for the keys column is not updated. As a result, when an index whose keys column exceeds 816 bytes is created and the index is subsequently fetched, as in a SELECT * FROM SYSINDEXES query, the prefetch buffer is written past the 816 bytes that have been allocated, which causes the Access Violation.

RESOLUTION

To resolve this problem, obtain the latest service pack for SQL Server 2000. For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
290211  (http://support.microsoft.com/kb/290211/EN-US/ ) INF: How to Obtain the Latest SQL Server 2000 Service Pack

STATUS

Microsoft has confirmed that this is a problem in SQL Server 2000. This problem was first corrected in SQL Server 2000 Service Pack 1.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Attach or restore a SQL Server 7.0 database to a SQL Server 2000 server.
  2. Execute the following SQL statements to create a table and an index, whose keys column exceeds 816 bytes:
    use <dbname>
    go
    
    if object_id('t1') is not null
     drop table t1
    go
    
    create table t1 (c1 int, c2 int, c3 int, c4 int, 
     c5 int, c6 int, c7 int, c8 int, c9 int, c10 int,
     c11 int, c12 int, c13 int, c14 int, c15 int, c16 int, c17 int,
     d1 int, d2 int, d3 int, d4 int, 
     d5 int, d6 int, d7 int, d8 int, d9 int, d10 int,
     d11 int, d12 int, d13 int, d14 int, d15 int, d16 int, d17 int )
    go
    
    create clustered index i_t1 on t1 (c1, c2, c3, c4, c5, c6,c7, c8, c9, c10,
     c11, c12, c13, c14, c15, c16)
    create nonclustered index i_t2 on t1 (d1, d2, d3, d4, d5, d6,d7, d8, d9, d10,
     d11, d12, d13, d14, d15, d16)
    go
    					


  3. Execute the following query to reproduce the Access Violation:
    SELECT * FROM SYSINDEXES
    					
Also, the following stack dump and errors are seen in the SQL Server error log:
2001-04-02 17:55:04.09 spid51    Using 'sqlimage.dll' version '4.0.5'
Stack Dump being sent to d:\mssql8\MSSQL\log\SQL00011.dmp
2001-04-02 17:55:04.09 spid51    Error: 0, Severity: 19, State: 0
2001-04-02 17:55:04.09 spid51    SqlDumpExceptionHandler: Process 51 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process..
*******************************************************************************
*
* BEGIN STACK DUMP:
*   04/02/01 17:55:04 spid 51
*
*   Exception Address = 004270D7 (CStmtQuery::ErsqExecuteQuery(class CMsqlExecContext *,class CEsComp const *,class CEsComp const *,unsigned long *,int,int)const  + 0000044A Line 0+00000000)
*   Exception Code    = c0000005 EXCEPTION_ACCESS_VIOLATION
*   Access Violation occurred reading address 00000038
* Input Buffer 52 bytes -
*  select * from sysindexes  
*  
*******************************************************************************
Short Stack Dump
004270D7 Module(sqlservr+000270D7) (CStmtQuery::ErsqExecuteQuery(class CMsqlExecContext *,class CEsComp const *,class CEsComp const *,unsigned long *,int,int)const +0000044A)
00441A34 Module(sqlservr+00041A34) (CStmtSelect::XretExecute(class CMsqlExecContext *)const +0000021C)
004160DB Module(sqlservr+000160DB) (CMsqlExecContext::ExecuteStmts(class ExecutionContext *)+0000027E)
00415765 Module(sqlservr+00015765) (CMsqlExecContext::Execute(class CCompPlan *,class CParamExchange *)+000001C7)
00415410 Module(sqlservr+00015410) (CSQLSource::Execute(class CParamExchange *)+00000343)
005A683F Module(sqlservr+001A683F) (CStmtPrepQuery::XretExecute(class CMsqlExecContext *)const +00000211)
004160DB Module(sqlservr+000160DB) (CMsqlExecContext::ExecuteStmts(class ExecutionContext *)+0000027E)
00415765 Module(sqlservr+00015765) (CMsqlExecContext::Execute(class CCompPlan *,class CParamExchange *)+000001C7)
00415410 Module(sqlservr+00015410) (CSQLSource::Execute(class CParamExchange *)+00000343)
00459A54 Module(sqlservr+00059A54) (language_exec(struct srv_proc *)+000003C8)
004175D8 Module(sqlservr+000175D8) (process_commands(struct srv_proc *)+000000E0)
410735D0 Module(UMS+000035D0) (ProcessWorkRequests(class UmsWorkQueue *)+00000264)
4107382C Module(UMS+0000382C) (ThreadStartRoutine(void *)+000000BC)
7800BEA1 Module(MSVCRT+0000BEA1) (_beginthread+000000CE)
77E92CA8 Module(KERNEL32+00012CA8) (CreateFileA+0000011B)
-------------------------------------------------------------------------------
2001-04-02 17:55:04.49 spid51    clean_tables_xact: active sdes for tabid 22001-04-02 17:55:04.49 spid51    Process 51 unlocking unowned resource: KEY: 7:2:1 (790023da5d09)
2001-04-02 17:55:04.49 spid51    Error: 1203, Severity: 20, State: 1
2001-04-02 17:55:04.49 spid51    Process ID 51 attempting to unlock unowned resource KEY: 7:2:1 (790023da5d09)..
2001-04-02 17:55:04.50 spid51    clean_tables_xact: active sdes for tabid 22001-04-02 17:55:04.50 spid51    Process 51 unlocking unowned resource: KEY: 7:2:1 (790023da5d09)
2001-04-02 17:55:04.50 spid51    Error: 1203, Severity: 20, State: 1
2001-04-02 17:55:04.50 spid51    Process ID 51 attempting to unlock unowned resource KEY: 7:2:1 (790023da5d09)..
2001-04-02 17:55:04.50 spid51    Error: 0, Severity: 19, State: 0
2001-04-02 17:55:04.50 spid51    language_exec: Process 51 generated an access violation. SQL Server is terminating this process..
2001-04-02 17:55:04.50 spid51    clean_tables_xact: active sdes for tabid 22001-04-02 17:55:04.50 spid51    Process 51 unlocking unowned resource: KEY: 7:2:1 (790023da5d09)
2001-04-02 17:55:04.50 spid51    Error: 1203, Severity: 20, State: 1
2001-04-02 17:55:04.50 spid51    Process ID 51 attempting to unlock unowned resource KEY: 7:2:1 (790023da5d09)..
				

APPLIES TO
  • Microsoft SQL Server 2000 Standard Edition
Keywords: 
kbbug kbfix kbsqlserv2000sp1fix KB295114
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support