My presentation materials are below. Please note that the demo scripts are designed to work with the
AdventureWorks database. Some of them (the design demos) will work in almost any database. Others (the unit test demos) are schema specific.
Slide Deck
This includes several useful integrity checks, such as identifying the following:
- Possible missing foreign keys
- Foreign keys with datatype mismatches
- Foreign keys without indexes
- Tables without primary keys
- The number of stored procedures, views, and functions per table
This includes several deployment best practices, including:
- Re-runnable alter-table scripts
- Re-runnable index scripts
- Best practices for changing stored procedures, views, functions, and triggers
- Example versioning of a database
- Doing quick verification tests of deployed DB code
- Examples of how to deprecate tables, and then undo your work if you need to roll back
This includes several examples of how to unit test database objects, including:
- Unit Testing a Stored Procedure
- Unit Testing a table schema