Show solving arithmetic expression step by step

  • Scormer

    SSC Enthusiast

    Points: 184

    Comments posted to this topic are about the item Show solving arithmetic expression step by step

  • Bill Talada

    SSChampion

    Points: 11956

    Impressive how you use dynamic sql exec() function to have tsql resolve expressions within parentheses. It looks like your work was mainly in finding the innermost parentheses and working around a few quirks. Great way to simplify a task.

    At first I was expecting a recursive descent parser but this is much simpler but a bit fragile with no error checking.

    I would have liked cleaner code and a few comments to make it easier for us to understand.

    Great job,

    thanks.

  • j-1064772

    SSCertifiable

    Points: 5316

    I am curious as to why T-SQL is being used for this kind of application. I have difficulty envisaging a child connecting to SSMS and interactively typing-in an expression in a query analyzer window (not the greatest editor in the world) and without making a mistake, since it is assumed that the expression is entered correctly.

    In my view an application with a graphic user interface is far more likely to motivate a child in experimenting maths rather than experimenting the tedious manual entry in SSMS.

    More to the point, is an expression parser a legitimate application of T-SQL ?

  • kenn 46875

    Valued Member

    Points: 69

    Thanks, I'll check it out 🙂

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    Good fun script. I see it as something you would present the results to a child, not have them run the sql code.

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

You must be logged in to reply to this topic. Login to reply