I've created a stored procedure that creates a temp table. Now I need to be able to query over it using .NET. So I would need something like:
SELECT * FROM storedProcedure() WHERE ...
The table created by the stored procedure is dynamic as well so the schema will change. Using SQL Server 2005.
I cant use a function because what needs to be returned is a dynamic table. Having to define the table beforehand makes a function useless.
I ended up creating a global temp table with the help of dynamic SQL I was able to create a dynamic global temp table and access it via .NET.