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
 Transact-SQL (2000)
 open cursor on sp results within a sp - is it poss

Author  Topic 

tompotts
Starting Member

1 Post

Posted - 2002-06-10 : 07:14:46
A tricky one possibly...

I need to write a stored procedure which accepts another sp name as a param.
The new sp ultimately needs to do an insert based on the ID of each row returned by the sp (defined by the incoming sp name.)
The 'table definition' of each sp is different, but all have a common ID field.

My attempts/thoughts...
I'd like to be able to create a temporary table with one column - ID, and execte the sp, returning only the one ID column, INTO the temporary table. Then open a cursor on the temporary table.
Is this is possible...

Does anyone have any ideas!!

Any help would be greatly appreciated!
Cheers
Tom

robvolk
Most Valuable Yak

15732 Posts

Posted - 2002-06-10 : 07:18:51
Can you post your code? I bet we can do this for you without using cursors. At least we can give it a shot.

Go to Top of Page
   

- Advertisement -