FIX: Logging Large Error Messages May Generate Access Violation (197242)



The information in this article applies to:

  • Microsoft SQL Server 6.5

This article was previously published under Q197242
BUG #: 16775 (SQLBUG_65)

SYMPTOMS

When performing a database or transaction log dump, the SQL Server process attempts to log the action in the error log. If the length of the combined message exceeds the maximum error message size, the SQL Server will fail to log the message and may encounter a handled access violation (AV). Note that to exceed the message length, seven stripe dump devices with 255-byte names are required.

CAUSE

Large error messages exceed the internal message buffer, leading to unexpected behavior.

WORKAROUND

To work around this problem, reduce the size of the message to be logged. To do this, you can break the error message into smaller sections using the state to signify each relevant piece, as in the following example:
   raiserror("Part 1", 12, 1) with log
   raiserror("Part 2", 12, 2) with log
   raiserror("Part 3", 12, 3) with log
   go
				
This places the following in the SQL Server error log:
   1998-10-19 08:15:57.74 spid7    Error: 50000, Severity: 12, State: 1
   1998-10-19 08:15:57.74 spid7    Part 1.
   1998-10-19 08:15:57.82 spid7    Error: 50000, Severity: 12, State: 2
   1998-10-19 08:15:57.82 spid7    Part 2.
   1998-10-19 08:15:57.82 spid7    Error: 50000, Severity: 12, State: 3
   1998-10-19 08:15:57.82 spid7    Part 3.
				
NOTE: In versions of SQL Server earlier than SQL Server 6.5 Service Pack 5, the length restriction was 512 bytes. SQL Server 6.5 Service Pack 5 extends the allowable length to 1,024 bytes.

STATUS

Microsoft has confirmed this to be a problem in SQL Server 6.5. This problem has been corrected in Service Pack 5a for Microsoft SQL Server 6.5.For more information, click the following article number to view the article in the Microsoft Knowledge Base:

197177 INF: How to Obtain SQL Server 6.5 Service Pack 5a

For more information, contact your primary support provider.

Modification Type:MajorLast Reviewed:3/14/2006
Keywords:kbBug kbfix KB197242