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)
 Temp table vs regular table

Author  Topic 

PiecesOfEight
Posting Yak Master

200 Posts

Posted - 2001-03-29 : 10:34:40
I wrote a sproc to get a random set of keys from a table (thanks to all the great posts on the subject) and write to a temp table with a randomly generated name.

The problem I'm having is that when I try to write the keys to a temp table inside a loop, it complains about an invalid object, whereas it works fine when I use a regular table:


set @TempTable = 'tblTemp' + cast(round((rand() * 1000), 0) as varchar)


Any ideas? (Sql Server 7.0 on Win2K)



Edited by - PiecesOfEight on 03/29/2001 10:35:20
   

- Advertisement -