SF_ReplicateIAD
SF_ReplicateIAD
Usage
SF_ReplicateIAD
creates a local replicated table with the contents of the same object at Salesforce.com, including any archived or deleted records from the recycle bin. The name of the local table is the same name as the Salesforce.com object (i.e. Account). Any schema changes in the object at Salesforce.com are reflected in the new table.
Syntax
EXEC SF_ReplicateIAD '𝘭𝘪𝘯𝘬𝘦𝘥_𝘴𝘦𝘳𝘷𝘦𝘳','object_name'
where linked_server is your linked server name and object_name is the object name.
Example
The following example replicates the local Accounttable with the current data on Salesforce.com using the Salesforce linked server. Any archived or deleted records are included in the local table
EXEC SF_ReplicateIAD 'Salesforce' , 'Account'
Notes
-
SF_ReplicateIAD
creates a full copy and downloads all the data for that object from Salesforce. -
Do not try to
SF_Refresh
tables created withSF_ReplicateIAD
. Instead useSF_RefreshIAD
. -
SF_ReplicateIAD
only retrieves the deleted records that are currently in the Salesforce recycle bin. -
SF_ReplicateIAD
retains the permanently deleted rows from run to run. Once you begin to useSF_ReplicateIAD
for a table, do not useSF_Replicate
on the same table. If you runSF_Replicate
instead ofSF_ReplicateIAD
, you lose all the permanently deleted rows in the local table.
Options
-
bulkapi
—SF_ReplicateIAD
uses the Salesforce.com web services API by default. To use the Salesforce.com bulkAPI instead, add the optionalbulkapi
switch.SF_ReplicateIAD
then submits a BulkAPI job and polls for completion. You should only use BulkAPI for large tables.For example, to use the BulkAPI and poll for completion:
EXEC SF_ReplicateIAD 'Salesforce','Account','bulkAPI'
-
batchsize
—SF_ReplicateIAD
uses the maximum allowed batch size of 2000 rows. You may need to reduce the size to accommodate APEX code on the Salesforce.com server. To specify a different batch size, use thebatchsize(𝘹𝘹)
option after the operation.For example, to set the batch size to 50:
EXEC SF_ReplicateIAD 'Salesforce','Account','batchsize(50)'
-
pkchunk
—SF_ReplicateIAD
uses the Salesforce web services API by default. To use the Salesforce BulkAPI with the pkchunking header instead, add the optionalpkchunk
switch.SF_ReplicateIAD
then submits a BulkAPI job using the pkchunking header and polls for completion. Only use this option for large tables.For example, to use
pkchunk
and poll for completion:EXEC SF_ReplicateIAD 'Salesforce','Account','pkchunk'
The default batch size is 100,000. You can alter this using the
batchsize
parameter:EXEC SF_ReplicateIAD 'Salesforce','Account','pkchunk,batchsize(50000)'
-
NoDrop
—SF_ReplicateIAD
drops the local table by default. To useSF_ReplicateIAD
without dropping the local table, add the optionalNoDrop
switch.For example, to use
NoDrop
withSF_Replicate
:EXEC SF_ReplicateIAD 'Salesforce','Account','nodrop'