November 1, 2005 at 2:49 pm
Hi all,
Assume there is a system stored procedure: spSystemSP, will return some result, how can I write a statement like:
select myobject, exec spSystemSP as xxx, from mytable
Thanks.
November 1, 2005 at 3:08 pm
You could declare a variable of whatever datatype spSystemSP would return, then assign that variable to the results of spSystemSP and include that variable in your select.
Example:
declare @spResults int
set @spResults = 0
exec @spResults = spSystemSP
select myobject, @spResults as XXX, from mytable
November 1, 2005 at 3:09 pm
If you are using MS SQL Server 2000 you can use user defined functions on a row by row basis. What are you trying to do?
November 2, 2005 at 4:34 am
With regards to your SP, are you after
a) The resultset the SP returns
b) The value of an output param
c) The return value of the SP
?
November 2, 2005 at 7:36 am
I am using system sp to get sort of recordset, and then I need to combine this recordset within other select statement. I doubt if I can do this using single select statement, which is required in my coding. So, I decided to analysis the returned recordset outside SQL.
Thanks for all response.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply