Skip to content
Tool Review · Database Testing & Test Data

tSQLt

tSQLt is a free, Apache 2.0 unit testing framework for SQL Server written in T-SQL, with fake tables, procedure spies and table assertions; its latest release is V1.0.8083.3529 (February 2022).

Free Research-based review
Last verified November 2026. Version checked: V1.0.8083.3529 (17 February 2022). Features and pricing for commercial products change; check the vendor site for the latest details.
Product status: The most recent tSQLt release listed on tsqlt.org is V1.0.8083.3529 from 17 February 2022; no newer release notes were published by 7 November 2026, so treat the project as stable but slow-moving.
Vendor
tSQLt open source project (sponsored by Redgate)
Price
Free
Platforms
SQL Server (Windows or Linux)
Licence
Apache License 2.0
Product type
Open source T-SQL unit testing framework (Apache 2.0)
Official site
Works with
SQL Server 2005 SP2 and laterSQL Server on LinuxAzure SQL Database (older 1.0.5873 build only, per the downloads page)

At a glance

Supported databasesSQL Server 2005 SP2 and later, including SQL Server on Linux
Data generationNone; tests insert the rows they need into faked tables
MaskingNot applicable
Referential integrityFakeTable removes constraints so tests can insert minimal rows
CI/CD integrationXML test results for CI servers; GitHub Actions and Azure DevOps used by the project
Test automationUnit tests for procedures, functions and views in T-SQL
Data volume or subsettingNot applicable
DeploymentInstalled into a development database; requires CLR and a one-time server preparation
LicensingFree, Apache 2.0; Redgate SQL Test is a paid GUI on top
Azure SQLOlder 1.0.5873 build for Azure SQL Database per the downloads page; Managed Instance not documented
Short answer

tSQLt is the standard free choice for unit testing stored procedures, functions and views inside SQL Server, and it is what Redgate SQL Test runs under the hood. Each test runs in a transaction and can fake tables so it does not depend on existing data. The current build needs a CLR assembly and a server preparation step, it should never be installed in production, and releases have been quiet since 2022.

How we know: This profile is research-based: features, installation requirements, release history and licensing were checked on 7 November 2026 against tsqlt.org (home, quick start, downloads and release notes), the tSQLt GitHub repository and Redgate's SQL Test page. We have not run tSQLt.

Overview

tSQLt is a database unit testing framework implemented as T-SQL objects (plus a CLR assembly) that you install into a development database. Tests are stored procedures grouped into test classes, which are schemas; tSQLt runs each test inside a transaction and rolls it back, so tests stay independent without cleanup code. Test doubles such as FakeTable, FakeFunction and SpyProcedure isolate the code under test from real tables and dependent procedures.

The project documents compatibility with all SQL Server editions from 2005 SP2, and V1.0.7942 (September 2021) was certified for SQL Server on Linux and added DACPAC installation. The quick start says PrepareServer.sql, run once per server with sysadmin rights, enables CLR and installs a certificate so strict CLR security does not need to be disabled. The downloads page offers the older 1.0.5873.27393 build as the one that works with SQL Server 2005 and Azure SQL Database; support for Azure SQL Managed Instance is not documented.

Key features

  • Tests written as T-SQL stored procedures, grouped into schema-based test classes with shared setup
  • Automatic transaction per test with rollback, so tests do not leave data behind
  • FakeTable and FakeFunction to replace real tables and functions with empty or controlled versions
  • SpyProcedure to record calls to dependent procedures, with an optional @CallOriginal parameter (V1.0.8043)
  • AssertEqualsTable and other assertions for comparing result sets and values
  • Plain text or XML output for continuous integration servers
  • Installation by script or by SQL Server version-specific DACPACs

Integrations and ecosystem

Redgate SQL Test (SSMS add-in)SQL Server Management StudioDACPAC deploymentCI servers via XML resultsGitHub ActionsAzure DevOps

Pros and cons

Pros

  • Free and open source under Apache 2.0
  • Tests live in the database and are written in T-SQL, the language under test
  • Test doubles make it practical to test one procedure in isolation
  • Sponsored by Redgate, with a commercial SSMS front end (Redgate SQL Test) if you want one

Cons

  • No release since February 2022
  • Needs CLR and a sysadmin-run PrepareServer step; must not be installed in production
  • Current build is not documented for Azure SQL Database or Managed Instance
  • SQL Server only

Pricing

tSQLt is free and open source under the Apache License 2.0. Redgate sells SQL Test, an SSMS add-in built on tSQLt, at $303 per user per year (1-4 users) or inside SQL Toolbelt Essentials, but tSQLt itself needs no licence.

Pricing checked on the vendor's official page on 7 November 2026. Prices change; confirm before buying.

Who it is best for

SQL Server teams that keep business logic in stored procedures and want automated, isolated unit tests for that code in development and CI.

Typical use cases

  • Unit testing a pricing or billing stored procedure against faked input tables
  • Checking that a procedure calls an audit procedure, using SpyProcedure
  • Running database tests on every pull request in a CI pipeline
  • Guarding against regressions when refactoring legacy T-SQL

Who should look elsewhere

  • PostgreSQL teams: pgTAP fills the same role there.
  • Teams whose main target is Azure SQL Database with the current build, where the documented support is limited to an older release.

Verdict

Our take

tSQLt remains the practical default for unit testing T-SQL code, free and backed by a Redgate commercial front end. Weigh the CLR and server preparation requirements, the lack of releases since 2022 and the limited documented Azure SQL support before standardising on it for cloud-hosted databases.

Frequently asked questions

Is tSQLt free?

Yes. tSQLt is open source under the Apache License 2.0. Redgate SQL Test, which adds an SSMS interface on top of tSQLt, is a paid product.

Does tSQLt work on Azure SQL Database?

The tSQLt downloads page offers the older 1.0.5873.27393 build as the version that works with Azure SQL Database. The current build installs a CLR assembly and a server certificate, and its notes do not document Azure SQL Database or Managed Instance support.

What is the latest tSQLt version?

V1.0.8083.3529, released on 17 February 2022, is the most recent release in the tsqlt.org release notes as of 7 November 2026.

Can tSQLt run on SQL Server on Linux?

Yes. Release V1.0.7942.19440 (September 2021) states that tSQLt is certified for SQL Server on Linux.

Sources

Checked November 2026.

Listed in: Database Testing & Test Data.

How we research reviews and what star ratings mean: our editorial method.

Compare your options

Browse the full tools directory or see the head to head comparisons.