22-25 April 2026

Get Started with tSQLt

Proposed session for SQLBits 2026

TL; DR

Unit testing of application code is obvious for most applications developers. Why is it not as wide spread for database objects such as schemas, stored procedures and functions? In this session you will get started with the tSQLt unit testing framework.

Session Details

Developers have unit tested their code "for ages". But database developers not so much. With tSQLt we have a good framework to implement unit tests for our database code and our database schema.

Once we get used to working with tSQLt, we might be ready to adapt Test Driven Development (TDD) for our database development, but in this presentation, I will focus on just getting started with unit testing.

I will present an overview of tSQLt and demo some basic and some not so basic unit tests for database schema and for programmability objects, such as:
- Validate table schema
- Validate scalar values
- How to setup test data for unit tests
- Mocking tables and calls to other programmability objects

3 things you'll get out of this session

Learn what a unit test is Learn how to use tSQLt for creating SQL Server unit tests Learn how to use Visual Studio database projects to create unit tests using tSQLt.