• kausmail (1/10/2012)


    This is working but I am looking soothing like a scaler function that can be used in Select statement. Any idea?

    select ..., dbo.fnExpressionToValue(Expr)

    from myTable

    That's a different requirement to the one you originally stated.

    In this case, you'd have to use a CLR as you can't execute a string in a function. If you need help writing one (and someone else doesn't post one in between), I'll knock up a simple one later on today.


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/