How to build a T-SQL Framework SQL Performance for Developers Jared Kirkpatrick September 21, 2019
Thanks To Our Sponsors
Jared Kirkpatrick 20+Years of database experience, focusing on SQL Server since 1999. Worked in a variety of settings, including three years as a Senior Database Engineer for match.com Consultant for SQL Solutions Group
Objectives What is a T-SQL Framework What are the features of the SSG Framework How to setup each feature How to leverage the framework through a template Review the feature data collected How to extend the framework
Database Development “Knowing how to write T-SQL does not make you a database developer, it just makes you dangerous.” “Good hardware can never completely overcome bad code."
What is a Framework Inversion of Control Default Behavior Program flow is not dictated by the caller but by the framework Default Behavior Must be useful and not a series of no-ops Extensibility Should be able to be extended by selective overriding/specific functionality Non-Modifiable The base code and program flow should be able to be extended, but should not be able to modify its intended behavior
SSG T-SQL Framework Features Error Handling Dynamic data driven engine that manages the error handling Activity Logging Logs processes and times in the database Batching TBD
Error Handling DEMO
Activity Logging Demo
Batching What stored procedure started the chain of procedures being executed? How long did each segment of the batch (or each procedure) take? How long did the entire batch take? Did all procedures in the batch execute successfully? Which procedure (if any) did not complete successfully?
Batching Demo
How to Build a Framework Conclusion