Validating Data from SQL Server¶
This page covers SQL Server-specific setup for Data validation. For workflow field definitions, see Data validation configuration reference.
Prerequisites¶
- SQL Server connection driver on Worker hosts. Install the Worker with the
sqlserverextra to use the preferredmssql-pythondriver without a system ODBC installation. The Worker falls back topyodbcwhen the native driver isn’t available or the Worker TOMLextra_optionscontains an unsupported keyword. See Migrating Data from SQL Server.
Connectivity¶
Reuse [connections.source.sqlserver] Worker TOML from data migration:
Set prefer_native_driver = false to force ODBC. Set set_context_info = false if your audit triggers or other applications already use the SQL Server session’s CONTEXT_INFO slot.
Set source_platform: sqlserver in the validation workflow YAML. For partitioning, row alignment, and tolerance settings that apply to all platforms, see Data validation configuration reference.
Example workflow excerpt:
Data type mappings¶
| SQL Server type | Snowflake target type | Supported for validation | Notes |
|---|---|---|---|
| BIT, integers, DECIMAL, MONEY, FLOAT, REAL | NUMBER / FLOAT | Yes | |
| DATE, TIME, DATETIME types | DATE / TIME / TIMESTAMP | Yes | |
| CHAR, VARCHAR, NCHAR, NVARCHAR | VARCHAR | Yes | |
| BINARY, VARBINARY, UNIQUEIDENTIFIER | BINARY / VARCHAR | Yes | UUID compared as an uppercase string |
| TEXT, NTEXT | VARCHAR | Yes | Row-level comparison reads the full value; very large values may hit memory limits |
| XML, SQL_VARIANT | VARIANT | Partial | Schema-level comparison only |
| GEOGRAPHY | GEOGRAPHY | Yes | Compared as despaced Well-Known Text |
| GEOMETRY | GEOMETRY | Yes | Compared as despaced Well-Known Text |
| VECTOR | VECTOR(element_type, n) | Yes | Row-level validation compares element by element |
Platform-specific considerations¶
-
Starting validation: Ask the agent to generate a validation workflow with the depth you need (schema validation, metrics validation, and row-level validation, per table).
Prompt:
-
Anti-locking: Hints are off by default. On busy source tables, set
queryModifiers.objectModifierto" WITH (NOLOCK)"to avoid blocking on source locks, at the cost of dirty reads that can cause falseMISMATCHresults. See Anti-locking and query modifiers.Prompt: