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)
 SELECTing from sproc recordset output

Author  Topic 

Selector
Starting Member

3 Posts

Posted - 2001-06-18 : 06:33:15
I've looked thru the topics already posted, so if this has been covered and I've missed it I apologise ;-)

I want to SELECT a column from the recordset output of a sproc. Let's assume that my sproc code is as follows:

CREATE PROCEDURE up_GetOrderHeader AS

SELECT OrderID, OrderDate, OrderStatus
FROM Order

Nice and easy! I know that if I have created a table with the correct structure, I can do this:

INSERT INTO OrderHeader
EXEC up_GetOrderHeader

But can I say:

SELECT OrderID FROM EXEC up_GetOrderHeader

?

I know that this seems a bit wacky, but I need to do this for a very specific reason, so bear with me!

Cheers all

   

- Advertisement -