Quick Start
Here's a quick primer on how to start with data query and load operations in Speediful.
Complete the Installation
With the support of a system administrator, complete the installation steps.
When using Speediful for the first time in a database, or after upgrading, be sure to run the included SQL scripts to set up your environment.
Add a Salesforce Connection
Use the SLAM_add_connection procedure to add a Salesforce connection. The credentials will be tested. If successful, they will be stored and activated for use.
EXEC dbo.SLAM_add_connection
@username = 'username',
@password = 'password',
@token = 'security_token',
@domain = 'test', -- One of: login, test, or the Salesforce custom domain
@environment_name = 'partial' -- Alias that appears in activity log table
-- Check the active Username in SLAM_Settings
SELECT * FROM SLAM_Settings
Query Data
Use any one of the following procedures to query data:
- SLAM_query_soap
- SLAM_query_bulk
- SLAM_query_bulkv2
- SLAM_query for when you prefer to specify the API to use as a parameter
The query documentation explains advanced usage, including:
- Enabling PK Chunking
- Controlling the batch size
- Retrieving deleted and archived records
- What to do if the destination table already exists
Perform a full copy of a Salesforce object:
EXEC dbo.SLAM_query_bulk
@query = 'Account', -- When just the sObject name is provided, this is treated as SELECT * FROM sObject
@table = 'Account_query' -- The destination table. By default, if the table exists, it will be overwritten
SELECT * FROM Account_query
Or, providing a query string:
EXEC dbo.SLAM_query
@query = 'SELECT Id, Name, Email, Account.Name FROM Contact WHERE CreatedDate = TODAY',
@table = 'Contact_query',
@api = 'soap'
SELECT * FROM Contact_query
You will notice that every SLAM operation is logged:
SELECT * FROM SLAM_Activity_Log
Replication
Use SLAM_replicate for fast, parallelized multi-object extraction from Salesforce
-- Initiate simultaneous bulk replication of the objects below
EXEC dbo.SLAM_replicate
@sObjects = 'Account,Contact,Opportunity'
SELECT COUNT(*) FROM Account_replicated
SELECT COUNT(*) FROM Contact_replicated
SELECT COUNT(*) FROM Opportunity_replicated
Loading Data
Use any one of the following procedures to load data:
- SLAM_load_bulk
- SLAM_load_bulkv2
- SLAM_load_soap
- SLAM_load for when you prefer to specify the API to use as a parameter
- SLAM_lockbuster to prevent row-locking errors on bulk data loads
The load documentation explains advanced usage, including:
- DML Operation types
- Batch size
- Null and blank value handling
- SOAP option headers
- Dwell time between loads
- LockBuster usage
Basic behavior of all loading operations
General Requirements for Loading Data:
The input table should have an Id column defined as an NCHAR(18) or NVARCHAR(18) to receive the Salesforce Id returned by Salesforce.
Effect of Load Operations:
Every data load operation results in the following columns being added to the input table:
SLAM_Message- the end result of the operation:'Operation Successful.'or an error message return by SalesforceSLAM_unique_id(as needed) - a generated unique identifier if there is no available key column in the input table
As responses are received from Salesforce, the SLAM_* fields are populated and the Id column is written with the Salesforce Id from the response
When loading data to Salesforce, Speediful ignores rows with SLAM_Message = 'Operation Successful.' This approach makes it simple for users to correct data issues in-situ without risk of creating duplicate records, while also keeping Salesforce data processing volumes efficient
-- Create some test data
IF OBJECT_ID('Account_Test_LOAD', 'U') IS NOT NULL
DROP TABLE Account_Test_LOAD
CREATE TABLE Account_Test_LOAD ([Id] NVARCHAR(18), [Name] NVARCHAR(80), [Phone] NVARCHAR(255), [AnnualRevenue] DECIMAL(18, 0))
INSERT INTO Account_Test_LOAD
([Id], [Name], [Phone], [AnnualRevenue]) VALUES
(NULL, 'Universal Containers (Test)', '5553129876', 12450000 ),
(NULL, 'Northern Trail Outfitters (Test)', '5554168652', 5470000 ),
(NULL, 'Ursa Major Solar (Test)', '5552126842', 17500000 ),
(NULL, 'Get Cloudy Consulting (Test)', '5556581385', 10000000 )
-- Preview data to load
SELECT * FROM Account_Test_LOAD
EXEC dbo.SLAM_load_soap
@sObject = 'Account',
@table = 'Account_Test_LOAD',
@operation = 'insert'
-- Id, SLAM_Message and SLAM_unique_id will be populated
SELECT * FROM Account_Test_LOAD
-- If you run a SLAM load operation on this table again, only unsuccessful records will be sent!
-- Every activity gets logged
SELECT * FROM SLAM_Activity_Log
What Next?
This was a quick overview of the basic data read and write capabilities of Speediful. Want to explore further? Check the topics on the sidebar. Here are some of our favorite topics we wouldn't want you to miss!
SLAM_mapping_templateto generate customizable mapping documentsSLAM_table_templateto generate data-type correct tables for loading operationsSLAM_metadata_fieldsto retrieve field definitions for all sObjects in bulk- File Operations for working with Salesforce files