BUG: SELECT INTO Temp Tables w/Identity Columns May Cause ErrorsLast reviewed: February 2, 1998Article ID: Q180102 |
The information in this article applies to:
SYMPTOMSAn error 3905 or 631 can occur if both of the following conditions are true:
WORKAROUNDTo work around this problem, do either of the following:
STATUSMicrosoft has confirmed this to be a problem in SQL Server version 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThe following are the errors that would normally be seen in the SQL Server errorlog when this problem occurs:
Error : 631, Severity: 21, State: 1 The length of 35 passed to delete row routine for the row at offset 1946 is incorrect on the following page: Page pointer = 0x1016800, pageno = 319, status = 0x111, objectid = 3, indexid = 0 Error : 602, Severity: 21, State: 3 Could not find row in Sysindexes for dbid '2', object '1655676946',index '-1'. Run DBCC CHECKTABLE on Sysindexes. -or- Error : 3905, Severity: 21, State: 2 Can't unsplit logical page 316 in object 'syscolumns' in database 'pubs' - row number 12 is used on both pages. Error : 602, Severity: 21, State: 3 Could not find row in Sysindexes for dbid '2', object '98099390',index '-1'. Run DBCC CHECKTABLE on Sysindexes.Normally in this situation, the locks held by the client that caused the error will not be cleaned up, and will still show in the sp_lock stored procedure with a spid of -1. When this problem occurs, clients are unable to create temporary tables, and you can only stop the SQL Server with the SHUTDOWN WITH NOWAIT Transact-SQL statement. The following is an example of how to avoid the temporary table being created with the identity column property:
CREATE TABLE x (a int identity(1,1), b int) GO CREATE PROCEDURE sp_selectintoidentity AS SELECT Convert(int, a), b INTO #temp FROM x RETURN GO |
Additional query words: syscolumns 602
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |