Skip to main content

SLAM_query_soap

This command uses the Salesforce SOAP API to query the object. The SOAP API is suited to smaller volumes of records (either smaller tables or selective filtering). If no query is provided, all fields and records will be returned. The table is overwritten if it already exists.

Parameters:

NameTypeDefaultDescription
@queryNVARCHARRequiredsObject name or SOQL query string. When just an sObject name is passed, queries all records & fields
@tableVARCHARRequiredTarget SQL table name for results
@batch_sizeINT2000Number of records per batch (maximum 2000 for SOAP API)
@queryallBIT0When 1, includes deleted/archived records
@exists_actionVARCHAR(20)SLAM_Settings.default_exists_actionAction to take if the target object name specified by @table is already taken. If NULL, uses the value from SLAM_Settings.default_exists_action (defaulted to 'drop' during initial setup).

Valid options:
  • 'drop'
  • 'rename'
  • 'fail'

Usage Examples:

Retrieve all records and fields from the Account object:

EXEC dbo.SLAM_query_soap
@sObject = 'Account',
@table = 'Account_query'

Query with custom batch size for performance tuning:

EXEC dbo.SLAM_query_soap
@query = 'SELECT Id, Name, StageName, Amount, Owner.Name FROM Opportunity WHERE StageName = ''Closed Won''',
@table = 'Opportunity_query',
@batch_size = 1000

Retrieve deleted records, with batch size of 500:

EXEC dbo.SLAM_query_soap
@query = 'SELECT Id, Name, Email, Status, IsDeleted FROM Lead',
@table = 'Lead_queryall',
@batch_size = 500,
@queryall = 1