SQL Server Data Quality Kit v2.0
Plain T-SQL · SQL Server 2017+

Find the bad rows every morning, before your reports do.

Write a data quality rule as one row in a table. The kit checks it every day, fixes the simple errors itself with a full before-and-after log, and e-mails each data owner the exact records to fix or approve.

No agents, no services, no extra licences. Everything runs inside your database.
 rules.sql
INSERT dq.[Rule] (RuleCode, CheckType, TableName,
       ColumnName, FilterSql, OwnerEmail)
VALUES ('CUST-VAT', 'UNIQUE', 'sales.Customer',
        'VatNumber', 't.IsDeleted = 0',
        'sales.admin@yourco.com');

EXEC dq.usp_RunChecks;
SELECT * FROM dq.vOpenIssues;
RuleCodeStatusCheckedFailedSample
CUST-VATFAIL72CustomerId 1, 7
ORD-DATESFAIL41OrderId 101
ORD-TOTALFAIL41header 100.00 vs lines 79.00
PROD-PRICEPASS60
Output from the included demo database
Why

Bad data is cheap to fix early and expensive to fix late.

Reports nobody trusts

Duplicate customers, orphaned orders and blank fields quietly skew every dashboard built on top of them.

Problems found by accident

Someone notices a wrong invoice or a failed export weeks later. Nobody knows when it started or how many rows are affected.

No owner, no fix

IT sees the error but the business owns the data. The kit sends each owner their own list, with record keys, every day.

How it works

Install in five minutes. Add rules as you go.

  1. Run four scripts

    They create a dq schema with tables for rules, runs, results and bad-row samples, plus the procedures and report views.

  2. Describe your rules

    One row per check: table, column, check type, owner, severity and an optional threshold. A demo with 13 example rules shows every check type.

  3. Schedule and forget

    A SQL Server Agent job runs the checks at 06:00, e-mails owners through Database Mail and trims old history.

New in v2.0

Simple errors get fixed overnight. Nothing changes without a trace.

Extra spaces, wrong letter case, dashes in VAT numbers, old codes that map to new ones. Describe the correction once and the kit applies it every morning before the checks run.

Preview, then apply

Every fix runs in preview mode first and shows the old and the new value for each record. Undo restores the old values with one command.

Owner approval where it matters

Mark a fix as needing approval and the kit only proposes it. Owners see the proposals in their daily e-mail.

Built-in brakes

A fix that would touch more rows than expected is blocked. Records edited by people after a fix are never overwritten by an undo.

Nine check types

Covers the six classic data quality dimensions.

Completeness, uniqueness, validity, consistency, integrity and timeliness, plus your own SQL for anything else.

NOT_NULL

Missing or blank values.

UNIQUE

Duplicates on one column or a combination.

PATTERN

Values that do not match a LIKE mask, such as e-mails or product codes.

RANGE

Numbers or dates below a minimum or above a maximum.

ALLOWED_VALUES

Codes outside an approved list.

FOREIGN_KEY

Orphans with no parent row, even where no constraint exists.

EXPRESSION

Rows where a business condition is not true.

FRESHNESS

Tables that stopped being updated.

CUSTOM_SQL

Any SELECT that returns the bad records.

What's inside

Scripts you can read, change and own.

  • sql/01_schema.sqlRules, runs, results and samples tables
  • sql/02_procedures.sqlCheck engine and history purge
  • sql/03_report_views.sqlScorecard, open issues, trend and samples for Excel or Power BI
  • sql/04_autofix.sqlAutomatic fixes: preview, apply, approve, undo, change log
  • sql/05_owner_digest.sqlDaily HTML e-mail per owner, with preview mode
  • sql/06_agent_job.sqlReady-made SQL Server Agent job
  • demo/Demo tables with deliberate errors, 13 check rules and 7 fix rules

Data Quality Playbook (PDF, 12 pages)

The scripts find the problems. The playbook helps you get them fixed in a real company.

  • A 30-day rollout plan, week by week
  • 40 ready rule ideas for customers, products, orders and HR data
  • Who owns what: a simple RACI for data owners and IT
  • Setting severity and thresholds without alert fatigue
  • A monthly review meeting that takes 30 minutes
Single-company licence
$49$79Launch price

One payment. Use it in every database your organisation runs, on any number of servers.

Instant download. Payment is handled by our online reseller, who acts as merchant of record and adds VAT or sales tax where it applies. See terms and refunds.
  • All SQL scripts with full source
  • Automatic fixes with a full audit trail
  • Demo database with 13 check rules and 7 fix rules
  • Data Quality Playbook (PDF)
  • Updates for 12 months
  • 14-day refund if it does not work in your environment
FAQ

Questions before you buy

Which versions are supported?

SQL Server 2017 or newer, any edition including Express. The kit was tested on SQL Server 2022. On Azure SQL Database the checks and views work, but e-mails and scheduling need Database Mail and SQL Agent, which that service does not have.

Will it slow down my database?

Each rule scans the filtered table once. Index the columns you filter on, keep heavy rules for the night, and limit samples. Counts are always complete.

What if a rule has a typo?

That rule is saved with status ERROR and its message, and every other rule keeps running.

Is my data sent anywhere?

No. Everything runs inside your SQL Server. The only thing that leaves it is the e-mail you configure.

Can I change the scripts?

Yes. You get the full source and may modify it for your organisation. Reselling or publishing it is not allowed.

I am a consultant. Can I use it for clients?

Yes, as long as each client holds its own licence.

SQL Server is a trademark of Microsoft Corporation. This product is not affiliated with or endorsed by Microsoft.