Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Dynamic SQL table creation

Author  Topic 

tintin31
Starting Member

14 Posts

Posted - 2001-02-27 : 16:53:44
Can anyone tell me why this does not work:

exec ( 'create table #test ( col_1 varchar(5), col_2 varchar(5) )' )
select * from #test

The execute command runs successfully. However, when I do the select I get the message:

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name '#test'.

   

- Advertisement -