• I had to try it for myself so here is your code ported to C#. It worked as advertised for me:

    [font="Courier New"]using System;

    using System.Data;

    using System.Data.SqlClient;

    using System.Data.SqlTypes;

    using Microsoft.SqlServer.Server;

    public partial class UserDefinedFunctions

    {

        [Microsoft.SqlServer.Server.SqlFunction]

        public static SqlString stringEval(string equation)

        {

            DataTable table = new DataTable();

            object eqObject;

            eqObject = table.Compute(equation, "");

            SqlString results = SqlDecimal.Parse(eqObject.ToString()).ToString();

            return results;

        }

    };

    [/font]

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato