
On February 17, I presented a webinar on How to Conduct a Database Design Review along with my co-presenter and fellow Head Geek Tom LaRock. If you missed it, you can watch the webinar now on demand <https://info.sentryone.com/webinar-how-to-conduct-a-database-design-review>.
During that webinar, I used a Transact-SQL script to show how to find all sorts of red flags in the design of a relational database, such as tables without primary keys, clustered keys, foreign keys, foreign keys without an accompanying non-clustered index, and much more. The intention of the script is not to comprehensively point out every issue with an instance of SQL Server or Azure SQL Database.
Instead, the script is intended to point out major issues about the quality of the relational database design of a SQL Server or Azure SQL database created by a vendor or an internal Dev team. The script has two major sections. The first part, which makes up the majority of the script, should be run in the database you’re reviewing. The second, much smaller section of the script and identified by in-line comments, can be run from the user database or Master and reveals issues with the database design that are best exposed when the supporting application is in use, since this portion of the script depends on examining active PerfMon counters, active queries in the cache, missing index warnings, and the like.
A few folks have asked about the script via email and social media, so I'm posting it here for your convenience. I'd love to hear your feedback if you have similar queries of your own that I haven't otherwise covered or if you have suggestions for improving the script.
By the way, this is one in a series of how-to webinars I’ll be presenting over the next several weeks. Other future how-to sessions include:
- How to Design and Normalize a Database (great for Devs and accidental DBAs!)
- How to Conduct a Database Code Review
- How to Conduct a SQL Server Configuration Review
For the latter two upcoming webinars, you'll also get a Transact-SQL file to help you identify all the red flags in each area. Meanwhile, if you're kicking yourself for having missed the live experience of the webinar, you can subscribe to the SentryOne (now a part of SolarWinds) events calendar <SentryOne Webinar Events Newsletter> towards the bottom of the webpage.
I look forward to seeing you at an upcoming webinar soon! Cheers,
-Kev