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)
 using result within stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-15 : 10:26:32
Anand writes "I want to use result of the recordset returned by select statement within the stored procedure itself. How to do this?"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-05-15 : 11:12:21
Well, it would help if you told us WHAT exactly you want to do with the results! Right now I'm reading your question as "I want to get in a car, turn the ignition key, put the car in gear and drive somewhere. How do I do that?"

Go to Top of Page

M.E.
Aged Yak Warrior

539 Posts

Posted - 2002-05-15 : 11:37:53
actually if you look at it Rob, I don't think he's putting it in gear.. just turning the keys and asking how to drive somewhere.

Go to Top of Page

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-05-15 : 13:05:26
quote:

Anand writes "I want to use result of the recordset returned by select statement within the stored procedure itself. How to do this?"



Quite often, you can use INSERT...SELECT.... syntax to populate a temp table with the resultset you've generated. However, it's usually more effiecint, albeit sometimes less readable, to make your SELECT actually a derived table in the FROM clause of the DML that requires the resultset.

<O>
Go to Top of Page
   

- Advertisement -