Generate railroad diagrams from Books Online

  • Hello All,

    Have you ever wanted to generate railroad diagrams from the Books Online grammar? That is, convert

    CREATE TABLE

    [ database_name . [ schema_name ] . | schema_name . ] table_name

    { AS FILETABLE |

    ( { <column_definition> | <computed_column_definition>

    |<column_set_definition> | [ <table_constraint> ] } [ ,...n ] } )

    to

    ?

    Well, now you can! Just go to http://www.colindaley.com/translator/. It's free as in free beer. Let me know what you think.

  • Colin Daley (8/27/2013)


    Hello All,

    Have you ever wanted to generate railroad diagrams from the Books Online grammar? That is, convert

    CREATE TABLE

    [ database_name . [ schema_name ] . | schema_name . ] table_name

    { AS FILETABLE |

    ( { <column_definition> | <computed_column_definition>

    |<column_set_definition> | [ <table_constraint> ] } [ ,...n ] } )

    to

    ?

    Well, now you can! Just go to http://www.colindaley.com/translator/. It's free as in free beer. Let me know what you think.

    Can't get there....our net nanny says that is a potentially dangerous site.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • Sigh. Well, I suppose that this means that I have got past the DNS problem at least.

    To be clear, do you mean "net nanny" as in http://www.netnanny.com?

  • If your program can do that, then I have to say "Nicely Done".

    However, I guess I'm the resident stick in the mud, though. If you compare the size of the RR Diagram to the syntax, then the syntax wins, so far as I'm concerned. I also like to copy the syntax out of BOL and just delete what I don't need. Bottom line is, they sure are pretty but I find no practical use in RR Diagrams by themselves. If people would list the syntax and display the RR Diagram instead of just doing one or the other, THEN they'd have a system worth looking at.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (8/27/2013)


    If your program can do that, then I have to say "Nicely Done".

    There is no need to ask if it can do that. Just try it. http://www.colindaley.com/translator/.

    If people would list the syntax and display the RR Diagram instead of just doing one or the other, THEN they'd have a system worth looking at.

    It can *almost* do what you want. My program actually calls another website (Railroad Diagram Generator - http://bottlecaps.de/rr) by Gunther Rademacher. His program generates diagrams from an EBNF syntax defined by the W3C. My program converts the T-SQL syntax to the W3C syntax and sends it to the Railroad Diagram Generator. If you clear the option to "Suppress EBNF display", then the diagram includes the syntax. Unfortunately, it will be the W3C syntax, which, apart from being useless in an SSMS query window, is a little verbose because it lacks some syntactic sugar that is present in the BOL syntax.

    Anyway, if you want text to paste in a query window, then go to BOL. If you want something that is easy to remember, then you can look at a diagram.

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

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