Starting from SQL Server 2012, it's possible to evaluate arithmetic/mathematical expression in T-SQL using this SQL CLR.
Code:
-- Without parameter
DECLARE @result1 INT = SQLNET::New('14200*5').EvalInt()
-- With parameter
DECLARE @result2 INT = SQLNET::New('X*Y').Val('X', 14200).Val('Y', 5).EvalInt()
-- SELECT 71000, 71000
SELECT
Leave a comment: