Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
Hi,

Can we use EXEC in function.I an getting error="Invalid use of a side-effecting operator 'EXECUTE STRING' within a function."

can we use another way to execute sql query in Function.

Thanks.
Posted

i dont think u can execute a procedure inside a function.
either convert both the function and procedure to procedures or convert them to functions

All The BEST
 
Share this answer
 
No. You need to use a stored procedure.
 
Share this answer
 
Comments
Pravinjas 30-Aug-11 8:46am    
is there any way to execute query in function?
Have a look at below link for simmilar Question-Answer thread.

Dynamic SQL Quesry in Function
 
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