Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
is its possible to call StoredProcedures from SQL UserDefined Functions. if so how can we do that?

Please help me.

Thanks
Krishna
Posted

1 solution

I do not think calling stored procedure in a function is possible. It's either you modify the stored procedure to be a function, or modify the function to be a stored procedure.

I your case, you may convert your the stored procedure into a function so that it can be called inside the function. You can do the DMLs inside your new function just like when it was a stored procedure. But to make it work, as with any other function, your stored procedure converted to function must return a value.

Other option that you may want to explore is the use of CLR.

Hope this helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900