Keploy as a SQL Server testing framework
Keploy mocks SQL Server by recording the TDS protocol beneath your driver, capturing the exact result sets your queries returned, then replaying them during tests. No SQL Server instance runs in CI, no schema is deployed, and no in-memory provider stands in for it.
keploy record -c "dotnet Orders.dll"What Keploy gives a SQL Server team
Captured at the TDS protocol
Keploy reads Tabular Data Stream beneath your driver, so the result sets that replay are the bytes SQL Server actually sent — column metadata, precision, and scale included.
- Below Microsoft.Data.SqlClient and JDBC
- Column metadata from the server itself
- Parameterised queries and sprocs
- Transactions replay in order
Why SQL Server integration tests slow teams down
The friction is rarely the assertions. It is everything around them — spinning up dependencies, keeping mocks honest, and repairing tests after every refactor.
Testing SQL Server: by hand, with Testcontainers SQL Server, or with Keploy
Testcontainers gives real T-SQL semantics and charges a large image pull and a server boot per job. Keploy records that server once and replays its responses with neither.
Select any row for the full comparison, with code.
What you write for SQL Server vs what Keploy records
All three produce the same assertion. Only the third still passes after the next refactor without anyone editing it.
The stub decides its own types and enforces nothing, so a precision mismatch or a violated constraint is impossible to reproduce.
Accurate down to decimal precision — and every job pulls a multi-gigabyte image, boots a server, and deploys the schema first.
Precision and scale come from SQL Server's own column metadata, so decimal handling is exercised on replay rather than assumed.
Times are estimates for authoring one endpoint’s coverage from scratch, not measurements.
SQL Server testing tools, compared
The options a team on relational databases actually reaches for, and where each one genuinely wins. Select a row for the full comparison.
Assessments reflect each tool’s documented behaviour, not benchmark measurements.
Record your SQL Server app once, replay it forever
Keploy sits below your SQL Server process at the network layer. It watches the calls your app already makes, then serves them back on replay so tests run with no dependencies attached.
Keploy records a GET call to /api/v1/orders/{id} on a SQL Server service and captures the dependency calls it makes.
SQL Server clients Keploy records, driver by driver
Keploy captures SQL Server at the wire protocol, so 4 of these 6 clients need no adapter, no test double, and no SQL Server instance in CI.
- Auto-mocked
.NETView page
Microsoft.Data.SqlClient, EF Core, and Dapper
- Auto-mocked
JavaView page
The Microsoft JDBC driver and Spring Data JPA
- Auto-mocked
Node.jsView page
the mssql package and Prisma
- Auto-mocked
PythonView page
pyodbc and SQLAlchemy
- Partial
GoView page
denisenkom/go-mssqldb
- Partial
PHPView page
PDO_SQLSRV
Your first SQL Server test suite in under five minutes
Every command below runs against your existing SQL Server service. Nothing in your source tree changes.
1Install the Keploy CLI
A single binary. It needs a Linux kernel with eBPF support, or Docker on macOS and Windows — and it adds nothing to your project's dependencies.
curl -sSL https://keploy.io/install.sh | bash2Record your service
Pass the command you already use to start the app. Keploy runs it and watches every socket it opens.
keploy record -c "dotnet Orders.dll"3Exercise the paths you care about
Run the app with your development SQL Server reachable. Every query it issues and every result set the server returns is captured together.
curl localhost:5000/orders/ord_1curl -X POST localhost:5000/orders/ord_1/confirm -d '{"paymentToken":"tok_123"}'4Replay in CI
Replay serves the recorded dependency responses, so the job needs no service containers and no Docker daemon.
keploy test -c "dotnet Orders.dll" --delay 12
Ready to try it on your own SQL Server service?
Works with the rest of your SQL Server stack
Keploy records at the network layer, so framework and driver choices inside your SQL Server app do not change how it captures traffic.
.NET
EF Core and Dapper traffic records without a driver wrapper.
Entity Framework Core
Queries record as the T-SQL they translate to.
Java
The Microsoft JDBC driver records at the TDS layer.
Dapper
Raw T-SQL records at the protocol below the connection.
Azure SQL
The same TDS protocol, so capture is identical.
Flyway
Migrations still run against a real server; only tests use mocks.
Testing the rest of your stack
- Languages
Keploy as a .NET testing framework
Test ASP.NET Core services against recorded EF Core queries and HTTP calls, without Moq setups or an in-memory provider.
Read the guide - Databases
Keploy as a PostgreSQL testing framework
Record the Postgres frontend/backend protocol once and replay real result sets in tests — no container, no pg-mem, no schema to rebuild.
Read the guide - Databases
Keploy as a MySQL testing framework
Mock MySQL at the wire protocol instead of standing up a container or swapping in H2 — the rows your queries really returned, replayed.
Read the guide - Caches & Stores
Keploy as a Redis testing framework
Record RESP traffic once and replay real cache hits, misses, TTLs, and pipeline responses without a Redis server in CI.
Read the guide - Databases
Keploy as a MongoDB testing framework
Mock MongoDB at the wire protocol — real documents, real BSON types, real aggregation results — without a mongod binary in CI.
Read the guide - Languages
Keploy as a Java testing framework
Generate JUnit-grade integration tests for any JVM service by recording the traffic it already serves.
Read the guide
Join our GlobalCommunity
Connect with developers worldwide. Follow updates, ask questions, share feedback, and ship faster with other Keploy builders.
“Best report of integration and API tests I've seen — which we don't get from RestAssured.”
G2“Future of microservices testing. I don't write tests now!”
G2 · 5/5“An amazing product that simplifies the automation.”
Gartner · 4.0