Microsoft KB Archive/276043

= FIX: Error Message 5180 May Occur When You Retrieve Text or Image Data =

Article ID: 276043

Article Last Modified on 10/16/2003

-

APPLIES TO


 * Microsoft SQL Server 2000 Standard Edition

-



This article was previously published under Q276043



BUG #: 236001 (shiloh_bugs)



SYMPTOMS
Reading a big text or image column within a session, which has the isolation level set to READ UNCOMMITED, may cause the following error message to occur:

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 or 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 the text or 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. However, because some of the text data pages were overwritten with arbitrary data, the pointer to the next text page might also become corrupted and thus an invalid page number is being referenced. The 5180 error message occurs due to an invalid file ID in the page number. Other errors might also occur, depending on the kind of corruption being introduced by the writer.



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 INF: How to Obtain the Latest SQL Server 2000 Service Pack



WORKAROUND
To work around this problem, do not perform dirty reads on text or image data.



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
Although the error message warns of possible data corruption, the data in the database has not actually been tampered with.