How can I return the results of a stored procedure into a query? For example, I have 4 stored procedures that take in variables and return a calculated value. I want to select every row on a table, pass in the variables to the stored procedures and output the calculated values as part of the select statement:<br>SELECT t.tnum, <br> t.tdate,<br> sp_01(t.tnum, t.tdate),<br> sp_02(t.tnum, t.tdate),<br> sp_03(t.tnum, t.tdate),<br> sp_04(t.tnum, t.tdate)<br>FROM tablea t<br><br>The above select does not work for me. I ended up creating a cursor and selecting tnum and tdate into it. Then I looped through the cursor and called the stored procedures for each row in the cursor. I inserted the result into a temporary table and then did a SELECT * FROM TEMPTABLE.<br>This method is very slow - it runs FOREVER. Is there a better way to do this?<br>I have worked with Oracle databases and in Oracle you can create a function which would call the stored procedure and return a value. Then, in the query, you can call the function. Is there anything comparable to this in MS SQL7?