Dynamic SQL and Testing in Isolation

Listener beware! This episode is full of danger as we tackle an interesting use case for Dynamic SQL. Dynamic SQL generally has a bad reputation in SQL Server circles, and with good reason. Dynamic SQL can open the door to many undesirable results - SQL Injection attacks being the most frightening of these. It can also be difficult to read, making maintenance problematic; however, in this episode one brave soul - Marathon's own Laura Moss - explains how she uses Dynamic SQL to help refresh a subset of production data to be used in their development environments. You know we are always suckers for an interesting use case and Laura delivers big time. While you won’t be able to plug and play her example into your environment, we hope it gets the wheels turning if you struggle to update your test environments.

Let us know what you think!

Have you found a way to use Dynamic SQL as a tool for good and not evil? Did you get any good take-aways from today's podcast or have some questions? Leave us a comment and some love ❤️ on LinkedIn, Twitter/X, Facebook, or Instagram. Thank you for listening!

Our Guest

laura moss 2021

Laura Moss

Laura Moss is a senior software engineer with Marathon Consulting. As a data wrangler, she specializes in data warehouse architecture and moving data between systems. Her inbox is always empty.

Most people will stay away from dynamic SQL because of the security risks. And I think it turns off a very powerful tool that, if used for good and not for darkness, is very helpful to developers.

Laura Moss

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