SLAM_replicate
Overview
SLAM_replicate efficiently copies multiple Salesforce objects in their entirety to SQL Server in parallel. The objects specified in @sObjects are submitted to run in parallel with the Bulk v1 API. Each sObject will be downloaded to a table with the provided @table_suffix (defaults to "_replicated").
There are length limitations in regards to the command that is sent to Speediful from SQL Server of 4,000 charactes. Long lists of objects may exceed this limit and fail to start Speediful correctly.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
@sObjects | NVARCHAR | Required | Comma-separated list of Salesforce object names to replicate |
@table_suffix | NVARCHAR | '_replicated' | Suffix to append to table names |
@pkchunksize | INT | 100000 | PK Chunksize to use for replication. Speediful will smartly disable PK Chunking for objects that do not support it. If NULL, PK Chunking is disabled |
@queryall | BIT | 0 | When 1, includes deleted/archived records |
@max_workers | INT | 20 | Number of parallel processing threads. Lower this number if experiencing issues with job processing on Salesforce |
@exists_action | VARCHAR(20) | SLAM_Settings.default_exists_action | Controls the behavior when the destination table name, specified by @table is already used. If NULL, uses the value from SLAM_Settings.default_exists_action (defaulted to 'drop' during initial setup).Valid options:
|
Usage Examples
Replicate multiple objects with default settings. Will create Account_replicated, Contact_replicated, Opportunity_replicated tables:
EXEC dbo.SLAM_replicate
@sObjects = 'Account,Contact,Opportunity';
Whitespace between items in the sObject list is ignored, so this is valid as well:
EXEC dbo.SLAM_replicate
@sObjects = 'Account
,Contact
,Opportunity';
Replicate with custom table suffix and batch size. This will create OpportunityLineItem_backup, WorkOrder_backup, WorkOrderLineItem_backup tables:
EXEC dbo.SLAM_replicate
@sObjects = 'OpportunityLineItem,WorkOrder,WorkOrderLineItem',
@table_suffix = '_backup',
@pkchunksize = 250000;
Full replication including deleted records with reduced parallelism:
EXEC dbo.SLAM_replicate
@sObjects = 'Case,CaseComment,FeedItem,Task,EmailMessage,Attachment,ContentVersion',
@table_suffix = '_full_backup',
@pkchunksize = 15000,
@queryall = 1,
@max_workers = 5;