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)
 Trouble with temp tables in SQL Server 2000

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-07-10 : 22:02:30
Alex writes "I'm having trouble working with a stored procedure I wrote for SQL Server 2000. Here's pretty much everything it does:


CREATE TABLE #mine
(
a int NULL,
b char(1) NULL
)

INSERT INTO #mine (a, b) VALUES (22, 'a')

SELECT * FROM #mine

DROP TABLE #mine


That is: create a temporary table, insert some stuff into it, and return a recordset from it (and clean up). And this works absolutely perfectly in SQL 2000 Query Analyzer. However, when I go to execute this SP in either VB or ASP (VBScript), it says that the recordset is closed -- not empty, but actually closed. When I remove the Insert line, it returns an empty recordset like it was supposed to. I even tried using the "table" datatype variables, but ran into the exact same problem. Any ideas on why this thing could be going crazy like that? Thank you kindly."
   

- Advertisement -