SLAM_query_bulkv2
Overview
This command uses the Salesforce Bulk v2 API to query the object. If an sObject name is provided instead of a SOQL query, all fields and records will be returned for that object.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
@query | NVARCHAR | Required | sObject name or SOQL query string. When just an sObject name is passed, queries all records & fields |
@table | VARCHAR | Required | Target SQL table name for results |
@queryall | BIT | 0 | When 1, includes deleted/archived records |
@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
Retrieve all records and fields from the Account object:
EXEC dbo.SLAM_query_bulkv2
@query = 'Account',
@table = 'Account_query'
Retrieve specific fields with filtering:
EXEC dbo.SLAM_query_bulkv2
@query = 'SELECT Id, Name, Email, Account.Name FROM Contact WHERE CreatedDate > LAST_N_DAYS:30',
@table = 'Contact_query'
Include deleted/archived records:
EXEC dbo.SLAM_query_bulkv2
@query = 'SELECT Id, Subject, Status, IsDeleted FROM Task',
@table = 'Task_queryall',
@queryall = 1