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.
| Author |
Topic |
|
sparrow37
Posting Yak Master
148 Posts |
Posted - 2009-11-19 : 15:10:47
|
| Hi all,I have following stored procredure which gives error on executionalter proc testasifasbegininsert into #temp SELECT [grBrandID], [grBrandName] FROM [USgrBrand] ORDER BY [grBrandName]select [grBrandID], [grBrandName] FROM #tempenderror isMsg 208, Level 16, State 0, Procedure testasif, Line 4Invalid object name '#temp'.Please help me on this.Regards,Asif Hameed |
|
|
russell
Pyro-ma-ni-yak
5072 Posts |
Posted - 2009-11-19 : 15:22:06
|
| you have to create the table b4 you can insert data into it. or you can do it on the fly:SELECT [grBrandID], [grBrandName] into #temp FROM [USgrBrand] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-11-22 : 00:56:57
|
| also seehttp://databases.aspfaq.com/database/should-i-use-a-temp-table-or-a-table-variable.html |
 |
|
|
|
|
|