I have got a column in my table which stores mathematical formulas as strings. The base question is how do I evaluate the "string formula" to get result?
For example, I got a value like '2*5+2*5*4'.
I need a way to evaluate this string within an SQL Server stored procedure to get the result as 50
Declare @weight as string
Declare @output as numeric(18,2)
SET @weight = '2*5+2*5*4'.
Set @output = somefunction(@weight)
OutPut should be 50.
Thanks in advance for your help
For example, I got a value like '2*5+2*5*4'.
I need a way to evaluate this string within an SQL Server stored procedure to get the result as 50
Declare @weight as string
Declare @output as numeric(18,2)
SET @weight = '2*5+2*5*4'.
Set @output = somefunction(@weight)
OutPut should be 50.
Thanks in advance for your help
Comment