View Single Post

   
  #5 (permalink)  
Old 02-29-2008, 07:50 AM
Erland Sommarskog
 
Posts: n/a
Default Re: Getting Data from a storeed procedure in a stored procedure

[posted and mailed]

Chris Auer (chris.auer@gmail.com) writes:
> What I am looking to do is use a complicated stored procedure to get
> data for me while in another stored procedure.
>
> Its like a view, but a view you can't pass parameters to.
>
> In essence I would like a sproc that would be like this
>
> Create Procedure NewSproc
> AS
>
> Select * from MAIN_SPROC 'a','b',.....
> WHERE .........
>
>
> Or Delcare Table @TEMP
> @Temp = MAIN_SPROC 'a','b',.....
>
> Any ideas how I could return rows of data from a sproc into another
> sproc and then run a WHERE clause on that data?


There are a couple options, please see an article on my web site:
http://www.sommarskog.se/share_data.html.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Reply With Quote