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
 Transact-SQL (2000)
 FIND ERROR

Author  Topic 

Kulwinder
Starting Member

18 Posts

Posted - 2005-02-04 : 11:00:14
CREATE PROCEDURE GetResponseTable
as
BEGIN
DECLARE @strQuery nvarchar(3000)
set @strQuery = 'CREATE TABLE #tmpResponse(ResponseID bigint)'
exec sp_executesql @strQuery
set @strQuery = N'INSERT INTO #tmpResponse values(12)'
exec sp_executesql @strQuery
END

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-02-04 : 11:11:29
i guess your problem is you can't do select * from #tmpResponse
that's because #temp table is local to the batch.
if you wan't it to work over muiltiple batches use a global ##temp table: ##tmpResponse


Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -