A Dynamic SQLChallenge (32 minutes)

In this challenge, you are tasked with editing a stored procedure to gather data from multiple databases. What’s the most efficient way to do it? Try your hand at the challenge, then check out three different suggested solutions.


Grab the scripts here: https://github.com/LitKnd/SQLWorkbooks/tree/main/a_dynamic_sql_challenge

Notes on the demo:

This SQLChallenge does NOT require restoring a database. The setup script generates all the databases you need. See the scripts and videos for full details.

This demo will NOT work as-is in Azure SQL Database. That’s because accessing multiple databases requires setting up External Tables and using Elastic Database Queries in that “Platform as a Service” solution.