If you write code to SQL Server then you might be interested in this: at the end of 2017 I wrote a tSQLt tdd training course which has helped over 300 people learn both tSQLt and how to apply TDD practices to their SQL Server T-SQL development, you can join the course at https://courses.agilesql.club. The course is free if you are happy to wait 10 weeks to complete it, with 1 lesson being made available per week - if you are in more of a hurry or you would like to help support the project you can purchase the course which makes it instantly available to you.
Writing code to generate TSql using the ScriptDom is hard. There is a seemingly bewildering array of objects you can use and where you use different types is unclear, I think this is due to the complexity of the task, it really isn’t simple and dealing with t-sql gets complicated very quickly - to be clear the ScriptDom is a great tool and although is difficult to use is 1 million times better than writing custom parsers / generators for t-sql.
To help I have written the ScriptDom visualizer which parses some t-sql and produces a tree of the different objects and properties that the ScriptDom needs for you to generate the same query via the ScriptDom rather than via text.
The ScriptDom is cool as it lets us generate valid t-sql as well as parsing t-sql, modifying and re-generating it so we can start to build our own tools to help sql developers - wahoo.
If you have no need to use the ScriptDom then this is a useless tool, if you need to interact with the ScriptDom in any way and you need to know what properties and types to use then this will be useful for you.
I have written it for me to use but am sure others will find it useful, it is as always on github, if you want to change anything just submit a pull request.
Look ma, pretty colours
Grab it from: