SLAM_table_template
Overview
Creates a SQL table with appropriate data types for the provided Salesforce object and operation type. The CREATE TABLE statement is also printed to the output.
Always use one of these tables to stage data for a Speediful load operation and pass it as the @table parameter. Populate this table by selecting and transforming "source data" as necessary. Supplying "source data" directly to Speediful for load operations will often result in errors due to incompatible data or data types.
This approach serves two very important purposes:
- Greatly reduces errors when the Salesforce load, update or delete is run because the data must be in the correct format and type
- Allows for a check point prior to sending information to Salesforce. The data can be reviewed to ensure completeness and correctness
It is MUCH easier to fix an issue in these staging tables than trying to recover a half complete Salesforce load
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
@sObject | NVARCHAR | Required | Salesforce object name to create template for |
@operation | NVARCHAR | Required | Operation type ('insert', 'update', 'upsert', 'delete', 'hardDelete', 'undelete') |
@table | NVARCHAR | Required | Target SQL table name to create |
@exists_action | VARCHAR(20) | NULL | 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
Create template for inserting new Account records:
EXEC dbo.SLAM_table_template
@sObject = 'Account',
@operation = 'insert',
@table = 'Account_insert_template';
Create template for updating existing Contact records:
EXEC dbo.SLAM_table_template
@sObject = 'Contact',
@operation = 'update',
@table = 'Contact_update_template';
Create template for upserting Opportunity records:
EXEC dbo.SLAM_table_template
@sObject = 'Opportunity',
@operation = 'upsert',
@table = 'Opportunity_upsert_template';