tSQLt
tsqlt.org
What it is
tSQLt is an open-source unit testing framework for Microsoft SQL Server. Developers write tests in T-SQL, organize them in schemas, and define shared setup methods there. Tests run automatically inside transactions to remain independent and reduce cleanup work. For isolation, tSQLt can fake tables and views and create stored procedure spies. Assertions include AssertEquals and AssertEqualsTable, while results can be generated as plain text or XML for continuous integration tools. The project says it works with SQL Server editions from SQL Server 2005 Service Pack 2 onward. tSQLt is self-hosted, released under the Apache 2.0 license, and the listed plan costs nothing. Installation requires running PrepareServer.sql once per server with SA permission, then installing the framework in a development database. The quick start explicitly says never to install tSQLt in production. Redgate SQL Test is named as its preferred SSMS plug-in.
Spec sheet
- Purpose
- tSQLt is an open source framework for unit testing SQL Server databases with tests written in T-SQL.Read 5 Oct 2026 · tsqlt.org
- Audience
- The site describes tSQLt as a way to bring unit testing and test-driven development to SQL Server database development.Read 4 Oct 2026 · tsqlt.org
- Integrations
- The site identifies Redgate SQL Test as its preferred commercial SSMS extension and the official SSMS plug-in for tSQLt.Read 5 Oct 2026 · tsqlt.org
- License
- The official repository identifies the license as Apache 2.0.Read 4 Oct 2026 · github.com
- Assertions
- The user guide includes assertions such as AssertEquals and AssertEqualsTable.Read 5 Oct 2026 · tsqlt.org
- CI output
- Test output can be generated as plain text or XML for integration with continuous integration tools.Read 4 Oct 2026 · tsqlt.org
- Dependency isolation
- The framework can fake tables and views and create stored procedure spies to isolate tested code.Read 5 Oct 2026 · tsqlt.org
- Downloads and source
- The downloads page offers the latest release, a version for SQL Server 2005 and currently Azure SQL Databases, and source code with tests.Read 5 Oct 2026 · tsqlt.org
- Installation
- Installation uses the included tSQLt.class.sql script in a development database.Read 5 Oct 2026 · tsqlt.org
- Integration
- The downloads page names Redgate SQL Test as its preferred SSMS plug-in for running tSQLt tests through a graphical interface.Read 4 Oct 2026 · tsqlt.org
- Isolation
- The framework can fake tables and views and create stored procedure spies to isolate code under test.Read 4 Oct 2026 · tsqlt.org
- Organization
- Tests can be grouped in schemas, which also allow common setup methods.Read 4 Oct 2026 · tsqlt.org
- Production limit
- The quick start says tSQLt should never be installed in production.Read 4 Oct 2026 · tsqlt.org
- Production limitation
- The quick start says tSQLt should never be installed in production.Read 5 Oct 2026 · tsqlt.org
- Security setup
- The PrepareServer.sql script enables CLR and installs a server certificate for tSQLt CLR; executing it requires SA permission and needs to be done once per server.Read 5 Oct 2026 · tsqlt.org
- SQL Prompt support
- The site offers a set of snippets for Redgate SQL Prompt to make working with tSQLt easier.Read 5 Oct 2026 · tsqlt.org
- SQL Server compatibility
- The site says tSQLt is compatible with all SQL Server editions from SQL Server 2005 Service Pack 2 onward.Read 5 Oct 2026 · tsqlt.org
- Support and community
- The quick start points users to the tSQLt mailing list, GitHub, Stack Overflow, and the SQL Server Community Slack #tsqlt channel.Read 5 Oct 2026 · tsqlt.org
- Support and learning
- The quick start links to a mailing list, GitHub, Stack Overflow, and the SQL Server Community Slack #tsqlt channel.Read 4 Oct 2026 · tsqlt.org
- Test language
- It lets developers implement unit tests in T-SQL.Read 4 Oct 2026 · tsqlt.org
- Test organization
- Tests can be grouped within schemas so teams can organize them and use common setup methods.Read 5 Oct 2026 · tsqlt.org
- Test output
- tSQLt can generate plain text or XML output to support integration with continuous integration tools.Read 5 Oct 2026 · tsqlt.org
- Training
- The site lists sqlity.net and dlmconsultants.com as vendors offering hands-on tSQLt and TDD training.Read 5 Oct 2026 · tsqlt.org
- Transaction isolation
- Tests run automatically within transactions to keep tests independent and reduce cleanup work.Read 5 Oct 2026 · tsqlt.org
- Transactions
- Tests run automatically within transactions to keep them independent and reduce cleanup work.Read 4 Oct 2026 · tsqlt.org
Plans and prices
Strong points and limits
Strong points
- Free plan costs nothing
- Tests run within transactions
- Fakes tables and views for isolation
- Plain text or XML CI output
- Supports SQL Server 2005 SP2 onward
Limits
- Should never be installed in production
- Installation requires SA permission
- Self-hosted setup is required
Who it suits
tSQLt suits SQL Server developers who want T-SQL unit tests, dependency isolation, and CI-friendly output. It is intended for development environments rather than production installations.
Verdict
tSQLt offers a focused, free testing framework for SQL Server database development. Its transaction handling, fakes, spies, and CI output cover core unit-testing needs, with a clear production restriction.
Where Specifiction places it
- Database Testing Tools#14 of 287.8