September 13, 2005 at 2:58 pm
I am triying to Obtain the Cursor Data from a Store Procedure to other Store Procedure.
How I can make this?
Thanks
September 13, 2005 at 3:00 pm
Don't...
Why do you think you need to do this?
September 13, 2005 at 3:05 pm
I'm not exactly sure what you mean cursor data.
But you cannot easily pass Recordsets between stored procedures.
You have to persist the data to a temporary table and you have to call the procedures in a certain order to preserve the table/data.
Create a top level procedure, which creates a temp table, and then calls a nested procedure that populates the temp table.
Then the calling table will have access to the temp table, and the data in it.
Create Nestedprocedure as
Insert into #TEMP
Select data
from Table
Go
create Proc1 as
Create Table #TEMP(PK int identity, ....)
exec Nestedprocedure
Select data from #Temp
GO
I do not belieive you can declare a cursor, and then call a nested procedure to use the cursor.
Please post tables, sample data and information about what your trying to do.
You may be able to avoid nesting procedures, and cursors altogether
Damit Remi, Your too fast
September 13, 2005 at 3:08 pm
There's no such thing as too fast .
September 13, 2005 at 3:19 pm
Yes the Temproally table are one option, but there not is other easy and less expensive tecnically talking.
September 13, 2005 at 3:21 pm
I am trying to obtain and use data into a Store Procedure that other Store PRocedure Produces before.
Thank you.
September 13, 2005 at 3:31 pm
> I want stored procedure A to call stored procedure B, which returns a set of
> records from a table. Then, I want stored procedure A to perform work on
> these records. How do I call stored procedure B from within stored procedure
September 13, 2005 at 3:49 pm
A bit of light reading.
I do not believe there is an "Easier way"
This article discusses several options
Output Parameters
Rewriting query using table valued functions
Sharing TempTables
Insert/Exec
Openquery.
September 13, 2005 at 4:29 pm
As you say there is not an easy way to do that I gonna read.
But tanks for your help
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply