September 7, 2006 at 6:19 am
Hey all,
I've a stored procedure which returns a resultset with dynamically building an SQL Query. As I dont know how many columns will this resultset contain, I cannot create table with the predefined columns. For which, I want to know how can I create a new table from the resultset returned by the stored procedure.
--Ramesh
--Ramesh
September 7, 2006 at 7:18 am
I guess you could always build the create table statement in the proc and send it back to the calling proc ending the execution of the 2nd proc. Execute the statement in the main proc and recall the 2nd proc to then insert the data....
Now that I think more of it... why not make a first proc create the table and the 2nd, just the select part... You may have some repetitive code but I don't see any way around it.
September 7, 2006 at 7:40 am
In our application we have several SPs to get data from views/tables & then get the resultset in a data table & pass the required information to this SP which gives us the paged data. In this way, we have to call 2 SPs ( One to get records & other to get paged data  in each page.
We just want to eliminate the calling of one procedure & can directly get the paged data from this stored procedure.
--Ramesh
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply