Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • RE: Eval arithmetic statement function in SQL

    Oh yes. There is a limitation in SQL Server. We can't use Exec inside UDF.

    EXEC('Select' + @strStatement) can't be used inside your function. 🙁

    But the solutions remains intact. You...

  • RE: Eval arithmetic statement function in SQL

    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...

Viewing 2 posts - 1 through 2 (of 2 total)