• Why complicating when a simple solution is available?

    Create Function EvalSQLStatement(@strStatement as varchar(1000))

    returns decimal(12,2)

    As

    Begin

    Return Exec('Select' + @strStatement)

    End

    Exec('Select' + @strStatement) will evaluate the expression and give its results.