Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 select the return value from stored procedure

Author  Topic 

mavershang
Posting Yak Master

111 Posts

Posted - 2009-12-11 : 19:22:54
Hi. I am a rookie. I have a stored procedure which takes 2 input params, do some calculation and use a output param to return the value.

But how can I use this procedure as a function to do this:

select id1, id2, (exec sp_a id1,id2,@out) as 'value'
from table


Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-11 : 20:35:54
You would need to rewrite it as a function and not a stored procedure.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-12-12 : 01:03:39
see scalar user defined function given here

http://www.sqlteam.com/article/user-defined-functions
Go to Top of Page
   

- Advertisement -