SLAM_load
Overview
SLAM_load reaches all three APIs and file loading through one procedure. It calls the load procedure that matches @api, which is useful when the API is chosen at run time.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
@sObject | NVARCHAR | Required | Salesforce object name to load data into |
@table | NVARCHAR | Required | Input SQL table containing data to load |
@api | NVARCHAR | Required | API to use ('bulk', 'bulkv2', 'soap' or 'blob') |
@operation | NVARCHAR | Required | Operation type ('insert', 'update', 'upsert', 'delete', 'hardDelete', 'undelete') |
@bulk_parallel | BIT | 1 | Bulk v1 API only. Enable parallel batch processing when set to 1. Serial mode when 0 |
@batch_size | INT | NULL | Records per batch for SOAP/Bulk v1 API. Uses API defaults if NULL |
@externalId | NVARCHAR | NULL | External ID field name (required for upsert operations, required for bulkv2) |
@ignore_nulls | BIT | 0 | SOAP API only. Whether to ignore NULL values when sending data. When set to its default value of 0, NULL and empty string data are sent to Salesforce with the instruction to blank out the field. When set to 1, NULL values are ignored (existing data is preserved), but empty strings still blank out the field. See NULL and Blank Handling for detailed behavior across all APIs |
@dwell_time | FLOAT | 0 | SOAP API only. Wait time between batches in seconds |
@soap_options | NVARCHAR | NULL | SOAP API only. Additional SOAP headers and options. See SOAP Headers |
@failure_threshold | DECIMAL(5,2) | 100 | Allowable failure rate (0-100) as a percentage of rows. When the failure rate goes over the threshold, the load still finishes and writes each row's result to the input table, then the procedure raises SQL error 88302. When 100, no error is raised. |
@dry_run | BIT | 0 | When set to 1, validates field mapping and reports results without sending any data to Salesforce. See Dry Run |
Usage Examples
Load using Bulk v1 API with minimal parameters:
EXEC dbo.SLAM_load
@sObject = 'Account',
@table = 'Account_insert',
@api = 'bulk',
@operation = 'insert'
Load using Bulk v2 API with required external ID:
EXEC dbo.SLAM_load
@sObject = 'Contact',
@table = 'Contact_upsert',
@api = 'bulkv2',
@operation = 'upsert',
@externalId = 'Contact_External_Id__c'
Load using SOAP API with full control options:
EXEC dbo.SLAM_load
@sObject = 'Case',
@table = 'Case_load',
@api = 'soap',
@operation = 'insert',
@batch_size = 150,
@dwell_time = 2.0,
@soap_options = 'AllOrNoneHeader,allOrNone,true;EmailHeader,triggerUserEmail,false'