Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

temporary recordset in sql not stored in disk mem

Status
Not open for further replies.

dpimental

Programmer
Jul 23, 2002
535
0
0
US
All, some time ago, someone showed me a way to create some sort of collection / dataset / table that was not a temp table but some sort of collection that was gone the moment a query / proc was finished.

Anyone know what that is?

David Pimental
(US, Oh)
 
Table VARIABLE
Code:
DECLARE @Test TABLE (field list and types here)

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
In addition to Borislav's reply may be you're talking about Common Table Expressions (CTE).
 
I don't think that was it. But I'll try that.

I think it was some sort of disconnected recordset that allowed to select into it, use it in a join against the same or different tables and then when you were done, it didn't exist any more.

But, I'll try your technique.

David Pimental
(US, Oh)
 
yes, that's it.

The infamous common table expression.

Thanks to both of you!

David Pimental
(US, Oh)
 
Table variable did exactly what you want.
You can use it as a normal table anywhere in your query and after batch is finished it disappears.


Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top