Skip to main content

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 record
  • SLAM_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:

  1. Initial data validation
  2. Automated fixes
  3. 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.

important

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

important

This is an alpha feature. The procedure name and parameters may change in future releases.

Parameters​

NameTypeDefaultDescription
@sObjectVARCHARRequiredSalesforce object name to validate against
@tableVARCHARRequiredInput SQL table containing data to validate
@scopeVARCHAR'all'Validation scope: 'all', 'data', or 'relationships'
@autofixBIT0When set to 1, automatically fix qualifying issues in the input table
@autofix_severityNVARCHAR'errors'Severity filter for autofix: 'errors', 'warnings', or 'all'
@autofix_categoriesNVARCHARNULLComma-separated list of categories to autofix (NULL = all fixable). See Autofix Categories
@autofix_fieldsNVARCHARNULLComma-separated list of fields to include for autofix (NULL = all fields). Cannot be specified with @autofix_exclude_fields
@autofix_exclude_fieldsNVARCHARNULLComma-separated list of fields to exclude from autofix. Cannot be specified with @autofix_fields
@metadata_refreshBIT0When set to 1, forces a fresh metadata retrieval from Salesforce instead of using 15-minute cached metadata
@RecordTypeNameColumnVARCHARNULLName 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​

ScopeDescription
allRun all validation checks (default)
dataRun only data-type validation checks (picklists, required fields, emails, dates, etc.)
relationshipsRun 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:

  1. RecordTypeId (if populated) — takes priority. Values on the Name column are ignored for that row.
  2. RecordType-Name column (if RecordTypeId is blank for the row) — used as the fallback resolver. Blank includes NULL, whitespace-only, and #N/A.
  3. 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:

CategoryDescription
picklistStandard and multi-select picklist values, including RecordType-dependent picklists
emailEmail format issues
dateDate and DateTime format issues
checkboxBoolean/checkbox value issues
addressState and Country picklist issues
requiredRequired field issues

Autofix Severity Levels​

SeverityDescription
errorsFix only issues that would cause the API operation to fail (default)
warningsFix only issues that may cause unexpected behavior
allFix all fixable issues regardless of severity