|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to insert resultset from SP into a table? or use Select * FromI tried this (and other variations) in Query Analyzer - which did not work.
select * from (exec stp_Report_MonthlyCountHistory_Summary '24', '%', '3/13/06', '3/13/06') Is there a way to Select/insert the resultset from an SP? How to do this? Thanks, Rich Rich,
Create a temporary or permanent table with the same structure as the result of the sp. Use: insert into #t1 exec dbo.usp_p1 ... AMB Show quote "Rich" wrote: > I tried this (and other variations) in Query Analyzer - which did not work. > > select * from (exec stp_Report_MonthlyCountHistory_Summary '24', '%', > '3/13/06', '3/13/06') > > Is there a way to Select/insert the resultset from an SP? How to do this? > > Thanks, > Rich > Thank you. Yes, I did see that this is the only way to do it. My objective
is that an SP which I did not create and don't want to modify returns a dataset that I need to order. So I want to read/write that data into a temp table so that I can order it. Show quote "Alejandro Mesa" wrote: > Rich, > > Create a temporary or permanent table with the same structure as the result > of the sp. Use: > > insert into #t1 > exec dbo.usp_p1 ... > > > AMB > > "Rich" wrote: > > > I tried this (and other variations) in Query Analyzer - which did not work. > > > > select * from (exec stp_Report_MonthlyCountHistory_Summary '24', '%', > > '3/13/06', '3/13/06') > > > > Is there a way to Select/insert the resultset from an SP? How to do this? > > > > Thanks, > > Rich > > Rich,
If you can order the resultset at the client side, then do it and you will be liberating some load from your sql server. AMB Show quote "Rich" wrote: > Thank you. Yes, I did see that this is the only way to do it. My objective > is that an SP which I did not create and don't want to modify returns a > dataset that I need to order. So I want to read/write that data into a temp > table so that I can order it. > > "Alejandro Mesa" wrote: > > > Rich, > > > > Create a temporary or permanent table with the same structure as the result > > of the sp. Use: > > > > insert into #t1 > > exec dbo.usp_p1 ... > > > > > > AMB > > > > "Rich" wrote: > > > > > I tried this (and other variations) in Query Analyzer - which did not work. > > > > > > select * from (exec stp_Report_MonthlyCountHistory_Summary '24', '%', > > > '3/13/06', '3/13/06') > > > > > > Is there a way to Select/insert the resultset from an SP? How to do this? > > > > > > Thanks, > > > Rich > > > |
|||||||||||||||||||||||