BUG: Creating Temp Table in SEM Causes Error 208

ID: Q141974


The information in this article applies to:

BUG# NT: 11526 (6.00)

SYMPTOMS

Creating a temporary table outside a stored procedure will generate the following message:

Error 208: Invalid Object Name '<temp table>'

You can encounter this problem when you use the SQL Enterprise Manager option "Manage Stored Procedures."


WORKAROUND

Use a query window to execute scripts containing temporary tables created outside stored procedures.


STATUS

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


MORE INFORMATION

The following three scenarios define the problem"

  1. Put the following code in the 'Manage Stored Procedures' window:
    
       create table #t1(a int)
       go
       create procedure test as
       select * from #t1
       go
     


  2. This will produce the following error:
    Error 208: Invalid Object Name '#t1'

    NOTE: It does not matter if the table in the create statement is different from the table referenced in the stored procedure. The following returns the same error:
    
             create table #t2(a int)
             go
             create procedure test as
             select * from #t1
             go
        

  3. If no temp tables are created outside the stored procedure, it works fine.
    
       create procedure test as
       select * from #t1
       go
     


  4. Creating a temp table without creating a stored procedure works fine.
    
       create table #t1(a int)
       go
     


Additional query words: sql6 winnt sem sproc


Keywords          : kbprg SSrvEntMan SSrvStProc kbbug6.00 
Version           : 6.0
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: March 23, 1999