BUG: System SPs Give Errors if 'Select Into' False for Tempdb

ID: Q151108


The information in this article applies to:

BUG#: 15179 (6.00)

SYMPTOMS

If you create a table with a primary key constraint consisting of more than one columns and run sp_helpconstraint on it, it will execute fine as long as the 'select into/bulkcopy' option is true for tempdb. As soon as you make it false, the first subsequent sp_helpconstraint gives the following message:

Msg 7130, Level 16, State 3
UPDATETEXT with no log is not valid at this time. Use sp_dboption to set
the 'select into/bulk copy' option on for database pubs.

Any subsequent attempts to run sp_helpconstraint on that table or any other table will give the following errors:
Msg 16915, Level 16, State 1
A cursor with the name 'cnst_csr' already exists
Msg 2714, Level 16, State 1
There is already an object named '#spcnsttab' in the database.
Msg 2714, Level 16, State 1
There is already an object named '#spcnstkeys' in the database.
Msg 16905, Level 16, State 1
The cursor is already open
Msg 267, Level 16, State 1
Object '#spcnsttab' cannot be found.


WORKAROUND

Do not set the 'select into/bulkcopy' option to false for tempdb because there is no practical benefit of doing that. Once you run into this situation, execute the following script from the same connection that gave the error:


close cnst_csr
deallocate cnst_csr
go
use master
go
sp_dboption 'tempdb', 'select into', true
go 


STATUS

Microsoft has confirmed this to be a problem in Microsoft SQL Server versions 6.0 and 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


MORE INFORMATION

This problem can be seen with any system stored procedure that uses SELECT INTO into a temporary table, e.g., sp_help, sp_helpconstraint, etc.


Keywords          : kbprg SSrvProg kbbug6.50 kbbug6.00 
Version           : 6.0 6.5
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: March 26, 1999