Article ID: 960770 - Last Review: January 23, 2009 - Revision: 2.1

FIX: You receive error 605 and error 824 when you run a query that inserts data into a temporary table in SQL Server 2008

Bug: #50003826 (SQL Hotfix)
Microsoft distributes Microsoft SQL Server 2008 fixes as one downloadable file. Because the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 fix release.
Expand all | Collapse all

SYMPTOMS

In Microsoft SQL Server 2008, you run a query that inserts data into a temporary table. The insert statement contains a subquery that references to the same temporary table. When you run the query, you may receive an error message that resembles the following:
Msg 605, Level 21, State 3, Line 1
Attempt to fetch logical page (1:225) in database 2 failed. It belongs to allocation unit 281474980315136 not to 504403158513025024.

If you run the query again, you receive another error message that resembles the following:

Msg 824, Level 24, State 2, Line 1
SQL Server detected a logical consistency-based I/O error: incorrect checksum (expected: 0x50758180; actual: 0x15658bfc). It occurred during a read of page (1:336) in database ID 2 at offset 0x000000002a0000 in file 'C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\DATA\tempdb.mdf'. Additional messages in the SQL Server error log or system event log may provide more detail. This is a severe error condition that threatens database integrity and must be corrected immediately. Complete a full database consistency check (DBCC CHECKDB). This error can be caused by many factors; for more information, see SQL Server Books Online.
In some cases, you may also receive an error message that resembles the following:
Msg 601, Level 12, State 3, Procedure Procecure Name, Line Line Number
Could not continue scan with NOLOCK due to data movement.

RESOLUTION

The fix for this issue was first released in Cumulative Update 3. For more information about how to obtain this cumulative update package for SQL Server 2008, click the following article number to view the article in the Microsoft Knowledge Base:
960484  (http://support.microsoft.com/kb/960484/ ) Cumulative update package 3 for SQL Server 2008
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
956909  (http://support.microsoft.com/kb/956909/ ) The SQL Server 2008 builds that were released after SQL Server 2008 was released
After you install this cumulative update package, you must enable trace flag 4135. To do this, you can add the -T4135 startup parameter, or you can use the dbcc traceon(4135) statement for an individual session.

WORKAROUND

To work around this issue, add a column that has a clustered primary key and an identity property to the temporary table. For example, run the following statement to alter the temporary table:
ALTER TABLE #TempTable
ADD id integer IDENTITY(1,1) CONSTRAINT id PRIMARY KEY CLUSTERED

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

For more information about what files are changed, and for information about any prerequisites to apply the cumulative update package that contains the hotfix that is described in this Microsoft Knowledge Base article, click the following article number to view the article in the Microsoft Knowledge Base:
960484  (http://support.microsoft.com/kb/960484/LN/ ) Cumulative update package 3 for SQL Server 2008

REFERENCES

For more information about the list of builds that are available after the release of SQL Server 2008, click the following article number to view the article in the Microsoft Knowledge Base:
956909  (http://support.microsoft.com/kb/956909/ ) The SQL Server 2008 builds that were released after SQL Server 2008 was released
For more information about the Incremental Servicing Model for SQL Server, click the following article number to view the article in the Microsoft Knowledge Base:
935897  (http://support.microsoft.com/kb/935897/ ) An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems
For more information about the naming schema for SQL Server updates, click the following article number to view the article in the Microsoft Knowledge Base:
822499  (http://support.microsoft.com/kb/822499/ ) New naming schema for Microsoft SQL Server software update packages
For more information about software update terminology, click the following article number to view the article in the Microsoft Knowledge Base:
824684  (http://support.microsoft.com/kb/824684/ ) Description of the standard terminology that is used to describe Microsoft software updates

APPLIES TO
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Workgroup
  • Microsoft SQL Server 2008 Web
Keywords: 
kbexpertiseadvanced kbfix kbsurveynew kbqfe KB960770
 

Article Translations

 

Related Support Centers