-- Evaluate dynamically expression in T-SQL DECLARE @tableFormula TABLE ( Formula VARCHAR(255), X INT, Y INT, Z INT ) INSERT INTO @tableFormula VALUES ('x+y*z', 1, 2, 3 ), ('(x+y)*z', 1, 2, 3 ) -- SELECT 7 -- SELECT 9 SELECT SQLNET::New(Formula) .ValueInt('x', X) .ValueInt('y', Y) .ValueInt('z', Z).EvalInt() as Result FROM @tableFormula
SQL Eval Function is a C# expression evaluator. You can evaluate arithmetic expressions, regex, and more directly in T-SQL.
Just click on Run button!
What we achieved over the last 5 years has grown beyond our hopes. That motivates us to continue to grow and improve all our projects. Every day, we are committed to listening to our clients to help ease the daily dev workload as much as possible.