SLAM_Alpha_validate_data
Overview
Validates SQL Server data against Salesforce metadata before loading. This helps identify data quality issues, allowing you to fix problems before committing to a load operation. Data validation identifies two severities of issues: 'errors' and 'warnings'. Errors would be rejected by Salesforce, while warnings will be accepted, but have a deleterious effect on data quality.
Validation issues are written to a {table}_Data_Validation results table in the same database with a single row per issue.
The original input table is modified with
SLAM_Data_Validation_Message: a concatenated list of all validation issues on the recordSLAM_Data_Validation_Status: The highest issue severity on the record (Error, Warning or OK)SLAM_Data_Validation_Autofix: BIT column if the row was modified by automatic data fixes
Autofix Behavior
When autofix is enabled, validation is performed twice. The process is:
- Initial data validation
- Automated fixes
- Revalidation to identify any new or remaining issues
The three data validation columns on the input table are updated to reflect the final state of the table after automatic fixes: SLAM_Data_Validation_Message, SLAM_Data_Validation_Status and SLAM_Data_Validation_Autofix
However, the {table}_Data_Validation table from the initial validation run is preserved with the full log of all issues identified.
The results of Data Validation are valid only for Bulk API Insert operations. The data validation results will not be valid for other APIs or operations
This is an alpha feature. The procedure name and parameters may change in future releases.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
@sObject | VARCHAR | Required | Salesforce object name to validate against |
@table | VARCHAR | Required | Input SQL table containing data to validate |
@scope | VARCHAR | 'all' | Validation scope: 'all', 'data', or 'relationships' |
@autofix | BIT | 0 | When set to 1, automatically fix qualifying issues in the input table |
@autofix_severity | NVARCHAR | 'errors' | Severity filter for autofix: 'errors', 'warnings', or 'all' |
@autofix_categories | NVARCHAR | NULL | Comma-separated list of categories to autofix (NULL = all fixable). See Autofix Categories |
@autofix_fields | NVARCHAR | NULL | Comma-separated list of fields to include for autofix (NULL = all fields). Cannot be specified with @autofix_exclude_fields |
@autofix_exclude_fields | NVARCHAR | NULL | Comma-separated list of fields to exclude from autofix. Cannot be specified with @autofix_fields |
@metadata_refresh | BIT | 0 | When set to 1, forces a fresh metadata retrieval from Salesforce instead of using 15-minute cached metadata |
@RecordTypeNameColumn | VARCHAR | NULL | Name of the SQL column containing the RecordType.Name (if not using the standard RecordTypeId column) |
Validation Checks
Data is checked for many types of issues, broadly fitting into these categories:
- Required fields
- Picklist values
- Multiselect picklist items
- Dependent picklists / multi-select picklists
- State and Country picklists
- Email fields
- Date fields
- Checkboxes
- Record Type restrictions
Validation Scopes
| Scope | Description |
|---|---|
all | Run all validation checks (default) |
data | Run only data-type validation checks (picklists, required fields, emails, dates, etc.) |
relationships | Run only relationship field validation checks |
Usage Examples
Basic Validation
Validate an Account table before loading:
EXEC dbo.SLAM_Alpha_validate_data
@sObject = 'Account',
@table = 'Account_insert'
-- Review validation results
SELECT * FROM Account_insert_Data_Validation
Validate with Autofix
Automatically fix errors in the input table:
EXEC dbo.SLAM_Alpha_validate_data
@sObject = 'Contact',
@table = 'Contact_insert',
@autofix = 1
Autofix Specific Categories
Fix only picklist and email issues:
EXEC dbo.SLAM_Alpha_validate_data
@sObject = 'Contact',
@table = 'Contact_insert',
@autofix = 1,
@autofix_categories = 'picklist,email'
Autofix with Field Targeting
Fix picklist issues only on specific fields:
EXEC dbo.SLAM_Alpha_validate_data
@sObject = 'Account',
@table = 'Account_insert',
@autofix = 1,
@autofix_categories = 'picklist',
@autofix_fields = 'Industry,Rating'
RecordType-Aware Validation
Validate picklists against RecordType-specific definitions:
EXEC dbo.SLAM_Alpha_validate_data
@sObject = 'Opportunity',
@table = 'Opportunity_insert',
@RecordTypeNameColumn = 'RecordType.Name'
RecordType Resolution Priority
When both RecordTypeId and a RecordType-Name column are present in the input table, the effective RecordType for each row is determined as follows:
RecordTypeId(if populated) — takes priority. Values on the Name column are ignored for that row.- RecordType-Name column (if
RecordTypeIdis blank for the row) — used as the fallback resolver. Blank includesNULL, whitespace-only, and#N/A. - Profile default RecordType — used when both columns are blank.
Case sensitivity of RecordTypeId values: an 18-character RecordTypeId must match the Salesforce Id exactly (case-sensitive) — Salesforce rejects case-mismatched 18-character Ids with MALFORMED_ID, so validation flags them as errors. A 15-character RecordTypeId is matched via its (case-sensitive) 18-character expansion. RecordType Name matching follows Salesforce upsert semantics (case-sensitive for the standard RecordType.Name column; case-insensitive when you supply your own @RecordTypeNameColumn).
If both columns contain data anywhere in the batch, a one-time warning is emitted naming the Name column in use:
Both RecordTypeId and <your_name_column> columns contain data. RecordTypeId
takes priority per row; <your_name_column> is used only when RecordTypeId is
blank.
This is informational — validation proceeds using the priority rules above.
Autofix Categories
The following category keys can be used with @autofix_categories:
| Category | Description |
|---|---|
picklist | Standard and multi-select picklist values, including RecordType-dependent picklists |
email | Email format issues |
date | Date and DateTime format issues |
checkbox | Boolean/checkbox value issues |
address | State and Country picklist issues |
required | Required field issues |
Autofix Severity Levels
| Severity | Description |
|---|---|
errors | Fix only issues that would cause the API operation to fail (default) |
warnings | Fix only issues that may cause unexpected behavior |
all | Fix all fixable issues regardless of severity |