FIX: Retrieving Text/Image Data May Return Error 5180

This article was previously published under Q276041
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 58316 (SQLBUG_70)
SYMPTOMS
Reading a big text/image column within a session with the isolation level set to READ UNCOMMITED may result in the following error:
Error: 5180, Severity: 22, State: 1
Could not open FCB for invalid file ID 0 in database '%s'. Table or database may be corrupted.
CAUSE
A text/image column is returned to the client in a sequence of text blocks. The size of those blocks is limited by the network packet size. If the row holding this text/image column happens to be deleted by another session while the other client still has not retrieved all text blocks, the pages previously assigned to the text data might get allocated by another session and be overwritten by this session.

In this case, the dirty reader might not become aware of this fact and continue to read text chunks from the deleted row. But since some of the text data pages were overwritten with arbitrary data, the pointer to the next text page might also get corrupted and thus an invalid page number is being referenced. This results in the error 5180, due to an invalid file ID in the page number. Other errors might also be returned, depending on the kind of corruption being introduced by the writer.
WORKAROUND
To work around this problem, do not perform dirty reads on text/image data.
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
Although the error message warns of possible data corruptions, the data in the database has not actually been tampered with.

For additional information on this problem in SQL Server 2000, click the article number below to view the article in the Microsoft Knowledge Base:
276043 BUG: Error Message 5180 May Occur When You Retrieve Text or Image Data
Properties

Article ID: 276041 - Last Review: 10/21/2013 02:28:14 - Revision: 2.1

  • Microsoft SQL Server 7.0 Standard Edition
  • kbnosurvey kbarchive kbbug kbfix kbqfe KB276041
Feedback