By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,505 Members | 1,850 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,505 IT Pros & Developers. It's quick & easy.

opening cursor on result set from stored proc

P: n/a
In SQL how can a cursor be opened to iterate the result set returned
from a stored proc

-Rahul Sood
rs*****@yahoo.com
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You can insert the procedure result set into a table. For example:

CREATE TABLE #ProcResults
(
SomeData int
)

INSERT INTO #ProcResults
EXEC MyProcedure

DECLARE MyCursor CURSOR
LOCAL FAST_FORWARD READ_ONLY FOR
SELECT * FROM #ProcResults

--
Hope this helps.

Dan Guzman
SQL Server MVP

-----------------------
SQL FAQ links (courtesy Neil Pike):

http://www.ntfaq.com/Articles/Index....partmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
-----------------------

"Rahul Sood" <rs*****@yahoo.com> wrote in message
news:aa**************************@posting.google.c om...
In SQL how can a cursor be opened to iterate the result set returned
from a stored proc

-Rahul Sood
rs*****@yahoo.com

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.