Re: CURSOR problem

From: Tom Moreau (tom_at_dont.spam.me.cips.ca)
Date: 08/04/04


Date: Wed, 4 Aug 2004 12:39:49 -0400

Consider a set-level solution that doesn't have to execute the proc once for
each row in the result set of the proc. Otherwise, insert the results of
the proc into a temp table and then run the cursor against it.

-- 
Tom
---------------------------------------------------------------
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
SQL Server MVP
Columnist, SQL Server Professional
Toronto, ON Canada
www.pinnaclepublishing.com/sql
"Girish" <gbajaj@tietronixinc.com> wrote in message
news:uog%23bCkeEHA.2852@tk2msftngp13.phx.gbl...
DECLARE accounts_cursor CURSOR FORWARD_ONLY FOR
 exec getAccountsData @AccountId
getAccountsData is a stored procedure. Is this not possible? I cant execute
a stored procedure and open up a cursor on that?
Thanks,
Girish


Relevant Pages

  • Re: Auditing SP Execute.
    ... As long as the users only have execute permissions on the proc i.e. they ... This assumes that the app doesn't use a single service ... > the stored procedure from enterprise manager or query analyser (others ...
    (microsoft.public.sqlserver.security)
  • DBI Stored Procedures and Cursors
    ... I have a stored procedure that belongs within a package in Oracle. ... This is my first exposure to DBI, so I'm sure i'm doing something ... The stored procedure is supposed to initialize the cursor and all I ... I can execute without any problems, ...
    (perl.dbi.users)
  • Re: calling one stored procedure from another
    ... but how do I "execute the stored procedure with the local ... >> There is an example of using a cursor in BOL under "declare cursor". ... >> columns, fetch them into local variables, and then execute the stored ...
    (microsoft.public.sqlserver.programming)
  • Re: calling one stored procedure from another
    ... but how do I "execute the stored procedure with the local ... "Scott Morris" wrote in message ... > define a cursor with a select statement that selects the appropriate ... > columns, fetch them into local variables, and then execute the stored ...
    (microsoft.public.sqlserver.programming)
  • Returning cursor from stored procedure
    ... I have a stored procedure that needs to return a record from one of two ... I'm using an outpur parameter of type cursor. ... Here's the stored proc.. ...
    (microsoft.public.dotnet.framework.adonet)