Never heard of ScriptDOM? Neither had we…okay, except Kevin, who obviously knows all. Apparently, the documentation is scarce. Mala Mahadevan uses it, loves it, and graciously offered to come back to the podcast to educate us and our listeners on a product that can help us parse, process and format our SQL queries.

3 Takeaways

  1. ScriptDOM allows you to create a document object model of a T-SQL query. You can then parse elements of the query just like SQL Server Management Studio does. It creates an abstract syntax tree (AST) representing the query.
  2. ScriptDOM provides two ways to parse the resulting tree: walk through the elements directly or use the Visitor pattern to find just the elements you want.
  3. ScriptDOM allows you to parse an existing query, check for syntax errors, and perform static code analysis. It will not generate a new T-SQL query from a syntax tree, so it is not an object-relational mapper (ORM).

If video is not working, please find it on YouTube at
Please Like, Subscribe, and hit the bell for notifications. Thank you!

Our Guest

mala mahadevan 768x768

Mala Mahadevan

Mala Mahadevan is a senior database professional with over 20 years of experience working with data, primarily in SQL Server and related technologies. She has been volunteering with SQL Server community for the past 15 years and is also a recipient of the PASSion award for being an outstanding volunteer. She is a featured blogger on and also blogs frequently at She is active on Twitter as @sqlmal.

It’s a beautifully engineered [product], but because it’s not documented, it’s not easy for someone to just go in there and use it.

Mala Mahadevan

Meet the Hosts

carlos chacon headshot

Carlos Chacon

With more than 10 years of working with SQL Server, Carlos helps businesses ensure their SQL Server environments meet their users’ expectations. He can provide insights on performance, migrations, and disaster recovery. He is also active in the SQL Server community and regularly speaks at user group meetings and conferences. He helps support the free database monitoring tool found at and provides training through SQL Trail events.

eugene meidinger headshot

Eugene Meidinger

Eugene works as an independent BI consultant and Pluralsight author, specializing in Power BI and the Azure Data Platform. He has been working with data for over 8 years and speaks regularly at user groups and conferences. He also helps run the GroupBy online conference.

kevin feasel headshot

Kevin Feasel

Kevin is a Microsoft Data Platform MVP and proprietor of Catallaxy Services, LLC, where he specializes in T-SQL development, machine learning, and pulling rabbits out of hats on demand. He is the lead contributor to Curated SQL, president of the Triangle Area SQL Server Users Group, and author of the books PolyBase Revealed (Apress, 2020) and Finding Ghosts in Your Data: Anomaly Detection Techniques with Examples in Python (Apress, 2022). A resident of Durham, North Carolina, he can be found cycling the trails along the triangle whenever the weather's nice enough.

Want to Submit Some Feedback?

Did we miss something or not quite get it right? Want to be a guest or suggest a guest/topic for the podcast?

Let's find what you're looking for