I have a variable in my database function:
@LocalVariable = '2*3*100'
I want to get the result by executing the expression in another variable. May any one advise on how to execute the expression? Also, I want to do it in a database function (not in a stored procedure). The result I expect is 600.
You could use
sp_executesql:Example at SE Data.