Types of Data Validation Explained
A practical comparison of the validation checks ETL teams use before data reaches databases, reports, APIs, and business applications.
Types of data validation describe the specific checks used to prove data is acceptable for an ETL workflow. Required field checks find blanks. Type checks catch values pretending to be dates. Range, format, duplicate, reference, consistency, and business rules catch the rest of the data circus before it reaches the target.
Different validation types catch different failures
A single validation rule cannot detect every data quality problem because bad data fails in different ways. A value can be present but the wrong type. It can be numeric but outside the allowed range. It can match a pattern but not exist in the reference table. It can pass every technical check and still break a business rule.
That is why production ETL processes use several data validation types together. Each rule answers one question. Is the value present? Is it the right type? Does it fit the target length? Does it match the expected format? Is it unique? Does it point to valid reference data? Does the row make business sense?
This article focuses on choosing and comparing validation types. If you need the broader definition and process, start with What is Data Validation?. If you want the full list of validation articles, use the Data Validation hub.
The practical goal is not to collect rules like commemorative teaspoons. The goal is to protect the target system and the decision that depends on it. A payroll import needs different checks from a marketing list. A product catalogue needs different checks from a warehouse stock update.
In most cases, the right validation design starts with the target contract. Target fields, database constraints, reporting rules, lookup tables, and business ownership tell you which validation techniques matter. The source system tells you where the trouble is likely to arrive wearing a false moustache.
Data validation types compared for ETL workflows
The table below summarizes the most common ETL data validation types. Use it as a routing map, not a replacement for detailed rule design.
| Validation type | Purpose | Typical use case | Example |
|---|---|---|---|
| Required Field Validation | Confirms that mandatory values are present. | Customer IDs, invoice numbers, order dates, account codes, and required status fields. | Reject a sales row when `customer_id` is blank. |
| Data Type Validation | Checks that values match the expected type. | Dates, integers, decimals, booleans, timestamps, and IDs. | Reject `TBC` in a date column before the database insert. |
| Range Validation | Finds values outside allowed limits. | Prices, quantities, percentages, dates, ages, balances, and sensor values. | Flag a discount of `500` when allowed discounts are 0 to 100 percent. |
| Length Validation | Checks that text fits expected length limits. | Database columns, codes, names, file references, and API fields. | Reject a 75-character product code for a target column limited to 30 characters. |
| Format Validation | Confirms that values follow an agreed representation. | Dates, times, file names, IDs, phone numbers, and structured exports. | Accept `2026-07-21` and reject `21/07/26` when the target requires ISO dates. |
| Pattern Validation | Uses a pattern or regex to check structured text. | Postcodes, product codes, invoice numbers, email-like fields, and custom IDs. | Validate that an order reference matches `ORD-2026-000123`. |
| Uniqueness Validation | Detects repeated values where only one should exist. | Primary keys, invoice numbers, customer IDs, order IDs, and business events. | Reject a second row with the same invoice number in the same supplier file. |
| Referential Integrity Validation | Checks that child records point to valid parent records. | Orders to customers, order lines to orders, products to categories, and invoices to accounts. | Reject an order line when the order header does not exist. |
| Consistency Validation | Checks that related values do not contradict each other. | Statuses, dates, totals, categories, currencies, and workflow states. | Flag a closed order that still has an open fulfilment status. |
| Business Rule Validation | Applies rules owned by the business. | Approval limits, closed periods, customer status, pricing rules, and compliance checks. | Reject a purchase order over an approval limit unless an approved flag is present. |
| Cross-Field Validation | Compares two or more fields in the same record. | Start and end dates, totals and components, debit and credit values, and paired identifiers. | Check that `line_total` equals `quantity * unit_price` after rounding. |
External references worth keeping nearby include IBM's data validation overview, Microsoft's primary and foreign key documentation, and ISO 8000 data quality standards.
Required Field Validation
Definition: Required field validation checks that a field contains a value when the workflow, target table, report, or business process cannot continue without it.
Example: Reject a sales row when `customer_id` is blank. In ETL, this is often the first gate after extraction. A missing customer ID, order number, invoice date, or account code makes later checks less useful because the workflow has nothing reliable to join, group, update, or report against.
When to use it: Use it for primary keys, business keys, dates, amounts, reference codes, and fields needed by target database `NOT NULL` columns. For setup details and edge cases, read Required Field Validation.
Data Type Validation
Definition: Data type validation checks whether a value can be safely treated as the expected type, such as date, integer, decimal, boolean, timestamp, or text.
Example: Reject `TBC` in a date column before the database insert. This protects database loads and calculations. A value that looks harmless in a spreadsheet can break a target insert or, worse, be silently converted into something wrong. Dates are the usual troublemakers. They arrive as text, regional formats, serial numbers, and the occasional `N/A` pretending it has business authority.
When to use it: Use it whenever source data comes from spreadsheets, CSV files, APIs, text exports, user forms, or older systems with loose typing. For setup details and edge cases, read Data Type Validation.
Range Validation
Definition: Range validation checks that numbers, dates, or other ordered values fall between allowed minimum and maximum limits.
Example: Flag a discount of `500` when allowed discounts are 0 to 100 percent. It catches values that are technically valid but operationally wrong. The amount may be numeric. The date may parse. That does not mean the amount belongs in the invoice or the date belongs in the current reporting period. This is where validation stops nonsense with a straight face.
When to use it: Use it for financial values, quantities, percentages, periods, dates, counts, ratings, and any field with known business limits. For setup details and edge cases, read Range Validation.
Length Validation
Definition: Length validation checks whether a value is too short, too long, or exactly the required number of characters.
Example: Reject a 75-character product code for a target column limited to 30 characters. It prevents truncation, failed inserts, and identifiers that no longer match their source after loading. Databases are not sentimental. If a target field accepts 50 characters and the source sends 80, the workflow needs a rule before the target throws a chair.
When to use it: Use it before loading fixed-length files, database fields with strict limits, product codes, account codes, identifiers, and external-system fields. For setup details and edge cases, read Length Validation.
Format Validation
Definition: Format validation checks that a value follows the expected layout before it is parsed, converted, stored, exported, or compared.
Example: Accept `2026-07-21` and reject `21/07/26` when the target requires ISO dates. Format checks are common for dates because `01/02/2026` can mean different things depending on who exported the file and how optimistic they were feeling. They also matter for filenames, identifiers, timestamps, and structured text passed to APIs.
When to use it: Use it when the target system expects a specific date format, timestamp format, file naming convention, ID layout, or export structure. For setup details and edge cases, read Format Validation.
Pattern Validation
Definition: Pattern validation checks text against a defined pattern, often using regular expressions, to confirm that structured values follow the expected shape.
Example: Validate that an order reference matches `ORD-2026-000123`. It is stricter than a simple length check but usually narrower than a business rule. Pattern validation confirms shape. It does not prove the value exists, belongs to a customer, or should be accepted by finance. A postcode can look right and still be the wrong postcode. Annoying, but honest.
When to use it: Use it for structured codes, identifiers, references, postcodes, file names, and fields where the shape carries meaning. For setup details and edge cases, read Pattern Validation.
Uniqueness Validation
Definition: Uniqueness validation checks that a field or field combination appears only once where duplicates would create incorrect updates, double counting, or unreliable reporting.
Example: Reject a second row with the same invoice number in the same supplier file. This is not only about database primary keys. In ETL, duplicates can appear inside one file, across several files, or between a new feed and existing target records. Duplicate rows are like relatives at Christmas. They keep showing up whether anyone planned for them or not.
When to use it: Use it for keys, transaction identifiers, event IDs, invoice numbers, imported files, and any measure that would inflate totals if repeated. For setup details and edge cases, read Uniqueness Validation.
Referential Integrity Validation
Definition: Referential integrity validation checks relationships between records so foreign keys, parent-child links, and reference dependencies remain valid.
Example: Reject an order line when the order header does not exist. Database constraints may catch these failures at load time, but ETL-side checks produce clearer error paths. They also let you decide whether to reject the row, hold the file, load parents first, or send missing reference data to an exception workflow.
When to use it: Use it whenever imported records depend on customers, accounts, products, departments, locations, users, or parent transactions. For setup details and edge cases, read Referential Integrity Validation.
Consistency Validation
Definition: Consistency validation checks whether values make sense together across fields, records, files, or systems.
Example: Flag a closed order that still has an open fulfilment status. A single field may pass its own rule while the record still makes no sense. A delivery date can be valid, and an order date can be valid, but the delivery date should not usually be before the order date unless your logistics team has borrowed the DeLorean.
When to use it: Use it when several fields describe the same business event, status, period, customer, product, or financial transaction. For setup details and edge cases, read Consistency Validation.
Business Rule Validation
Definition: Business rule validation checks data against organisation-specific rules that come from finance, operations, compliance, sales, support, or management reporting.
Example: Reject a purchase order over an approval limit unless an approved flag is present. This is where generic validation becomes useful to the actual business. A value may be present, typed correctly, in range, and formatted properly. It may still fail because the customer is inactive, the accounting period is closed, or the margin is below the allowed threshold.
When to use it: Use it when the rule affects money, customers, compliance, operational decisions, or management reports. For setup details and edge cases, read Business Rule Validation.
Cross-Field Validation
Definition: Cross-field validation compares fields in the same row or logical record to confirm that the relationship between them is valid.
Example: Check that `line_total` equals `quantity * unit_price` after rounding. It is closely related to consistency validation, but it usually works inside one record. The workflow might compare two dates, match a total against component values, confirm that a currency matches a country, or check that two related identifiers agree.
When to use it: Use it when the correctness of one field depends on another field in the same record. For setup details and edge cases, read Cross-Field Validation.
Database validation and ETL validation should work together
Database validation types are the checks enforced by the target database. They include `NOT NULL` constraints, data types, column lengths, primary keys, unique constraints, foreign keys, and check constraints. These rules are valuable. Keep them. A database without constraints is just a filing cabinet with commitment issues.
ETL validation sits earlier in the process. It catches predictable failures before the insert, update, API call, report export, or file write. That gives the workflow a better failure path. Instead of a database error saying a constraint failed, the ETL job can route the row to an exception table with the field name, failed rule, source file, row number, and correction owner.
The two layers answer different questions. Database constraints protect stored records. ETL validation protects the movement of data into that store and explains what happened when a row fails. In practice, use both. Let ETL validation catch and explain failures. Let database constraints enforce the final contract. Belt and braces, but for data.
Choose validation types from the source, target, and business risk
The simplest approach is to choose validation rules from five inputs: source systems, target databases, business rules, regulatory requirements, and reporting needs. Each input tells you something different.
Do not start by asking how many rules you can add. Start by asking what damage a bad row would cause after loading. If the answer is a failed dashboard refresh, choose enough checks to protect the report. If the answer is wrong payroll, duplicated invoices, or regulatory evidence, add stronger validation and clearer failure handling. Risk decides the rule set.
Source systems show likely defects
Excel, CSV, APIs, legacy databases, XML, JSON, and manual exports fail differently. Spreadsheets often need type, format, length, and blank checks. APIs often need schema, required node, status, and response validation. Legacy systems need careful reference and code checks because documentation may have left the building years ago.
Target databases define hard limits
Database validation types include not-null checks, data type checks, length checks, primary key checks, unique constraints, foreign key checks, and check constraints. ETL validation should catch predictable failures before the target rejects the row with an error message written for another database administrator.
Business rules define meaning
Technical checks prove shape. Business checks prove acceptability. Finance may own period rules, tax rules, approval limits, and account combinations. Operations may own stock status, location rules, and fulfilment states. Data stewards may own master-data values.
Regulatory requirements define evidence
Regulated data often needs logs, rejected-row records, repeatable rules, and proof that checks were applied. Validation design should include what failed, why it failed, when it failed, and what happened next.
Reporting needs define trust
Reports need consistent dimensions, valid dates, approved categories, reliable totals, and no hidden duplicates. If a dashboard drives decisions, validate the data before the chart turns bad input into a confident-looking lie.
Data validation is not the same as Data Cleansing or Data Transformation. Validation decides whether data passes rules. Cleansing fixes or standardizes known defects. Transformation changes structure, values, or meaning so the target can use the data.
Production ETL workflows combine several validation types
Real workflows rarely depend on one validation type. One rule catches one failure mode. A reliable ETL process chains checks together so obvious defects are caught early and expensive checks run only when the row is worth examining.
Consider a sales import from a supplier CSV into SQL Server. The workflow might run these checks:
- Confirm the file exists, has the expected header, and has not already been processed.
- Check required fields such as supplier ID, invoice number, product code, quantity, amount, and invoice date.
- Validate data types for dates, integers, decimals, and booleans.
- Check ranges for quantities, prices, discounts, and invoice dates.
- Apply length and pattern checks to product codes, account references, and invoice numbers.
- Use lookup tables to confirm supplier, product, currency, and account values.
- Detect duplicate invoice numbers inside the file and against loaded history.
- Apply business rules for closed accounting periods, inactive suppliers, and approval thresholds.
- Route rejected rows to an exception file with the failed rule and source row number.
- Load accepted rows and write counts for source, passed, failed, and loaded records.
This pattern keeps each rule understandable. It also makes support easier. When a row fails, the log should say why. "Import failed" is not a diagnosis. It is a shrug wearing a tie.
Common validation mistakes weaken otherwise good ETL processes
Validating too late
If the first serious validation happens inside the target database, the ETL process has already lost useful control. Validate source structure and basic fields before transformation, then validate target-ready output before loading.
Relying on one validation type
A required field check does not prove the value is valid. A type check does not prove the value is sensible. A format check does not prove the value exists in the business. Use the rule that answers the actual risk.
Missing business rules
Many bad records are technically valid. A closed accounting period, inactive customer, blocked product, or over-limit discount will pass basic checks unless the workflow includes business logic.
Poor error reporting
Rejected rows need a reason, source reference, failed field, failed rule, and run identifier. Without that, exception handling becomes archaeology with worse lighting.
Ignoring duplicates
Duplicates inflate reports, repeat payments, send repeated messages, and create customer confusion. Validate duplicate records at row, key, event, and file level where the process requires it.
Failing to validate reference data
A lookup rule is only as good as the reference table behind it. Validate reference data ownership, freshness, allowed values, and inactive records. Bad reference data is still bad data, just wearing a more official badge.
For wider examples, see Common Data Validation Mistakes and 22 Data Quality Checks Every Data Engineer Should Know.
Best practices for choosing validation types
Good validation rules are explicit, testable, and owned. They protect the target without turning the workflow into a bureaucratic obstacle course.
- Start with the target contract: required fields, types, lengths, keys, constraints, and accepted values.
- Keep raw source files and source rows unchanged for audit and recovery.
- Validate basic structure before expensive transformations or database writes.
- Use simple validation rules first, then add complex checks where risk justifies them.
- Separate row-level failures from job-level failures so one bad row does not always stop the whole process.
- Write rejected rows to a controlled exception table or file with the failed rule and source row reference.
- Use lookup tables for approved values rather than hard-coding lists inside several workflows.
- Validate duplicates inside the current file and against previously loaded data when double processing matters.
- Test edge cases: blanks, spaces, zero values, negative values, maximum lengths, old dates, future dates, and duplicate keys.
- Review rules with business owners when source systems, targets, products, periods, or compliance requirements change.
- Log passed rows, failed rows, warning rows, rejected files, and loaded rows on every run.
- Keep warning rules separate from rejection rules so important failures do not hide in noise.
The useful rule of thumb: validate what would be expensive, embarrassing, or risky to repair after loading. If the defect does not matter, do not build a shrine to catching it.
Checklist for selecting validation techniques on a new ETL project
Use this checklist before building a new import, migration, reporting feed, or automated data pipeline. It helps choose the correct data validation techniques without drifting into rule collecting.
- Which fields are required by the target database, API, report, or file export?
- Which source fields have unreliable data types, especially dates and numbers?
- Which values need minimum, maximum, or allowed period checks?
- Which text fields have target length limits?
- Which values need fixed formats or regular expressions?
- Which keys or business events must be unique inside the file and across previous loads?
- Which values must exist in lookup or reference tables?
- Which fields must agree with each other inside the same row?
- Which business-owned rules affect finance, customers, compliance, or operational decisions?
- Which failures should reject a row, create a warning, stop the job, or route the file for review?
- Where will rejected rows go, and who owns the correction process?
- What counts, totals, and logs prove that the validation step ran correctly?
Frequently Asked Questions
What are the main types of data validation?
The main types of data validation include required field validation, data type validation, range validation, length validation, format validation, pattern validation, uniqueness validation, referential integrity validation, consistency validation, business rule validation, and cross-field validation.
Which data validation type should an ETL workflow run first?
In most ETL workflows, start with structure, required fields, and data type checks. These rules confirm that the source is usable before the workflow spends time on transformations, lookups, and business rules.
Is data type validation the same as format validation?
No. Data type validation checks whether a value can be treated as a date, number, boolean, or other type. Format validation checks whether the value follows a specific representation, such as `YYYY-MM-DD` for dates.
What is the difference between format validation and pattern validation?
Format validation is usually used for known structures such as date and timestamp formats. Pattern validation is broader and often uses regular expressions to check product codes, postcodes, invoice references, and other structured text.
What are database validation types?
Common database validation types include not-null checks, data type checks, length checks, primary key checks, unique constraints, foreign key checks, check constraints, and lookup validation against reference tables.
What validation types improve data quality?
Data quality validation usually combines required field, type, range, format, uniqueness, reference, consistency, and business rule checks. No single rule proves data quality on its own.
How many validation rules should one ETL workflow use?
Use the rules needed to protect the target and the business decision. A low-risk one-off file may need only basic checks. A finance, customer, healthcare, or compliance workflow usually needs several validation types working together.
Should validation happen before or after data transformation?
Both are useful. Validate early to reject unusable source data, then validate again after transformation to confirm that the target-ready output meets field, key, range, and business rules.
What is an example of combining validation types?
A sales import might require customer ID, validate the invoice date type, check the amount range, confirm product codes in a lookup table, detect duplicate invoice numbers, and apply a business rule for closed accounting periods.
Can SQL be used for different types of data validation?
Yes. SQL works well for duplicate checks, joins to reference tables, cross-table comparisons, row counts, totals, foreign key checks, and staging-table validation.
When is manual validation enough?
Manual validation may be enough for a small one-off file with low risk. If the process repeats, feeds production, affects reporting, or needs evidence, automate the validation rules and keep logs.
How does Advanced ETL Processor handle validation types?
Advanced ETL Processor combines built-in validators, SQL, lookup tables, expressions, regular expressions, Python, business rules, routing, logs, schedules, and AI workflows inside one self-hosted ETL process.
Combine validation types in Advanced ETL Processor
Advanced ETL Processor combines validators, SQL, lookup tables, expressions, regular expressions, Python, business rules, routing, logging, scheduling, and AI workflows in one ETL process.
Download the 30-day fully functional trial and test the rules on a real workflow.
Validate early. Explain failures clearly. Keep the raw data unchanged.