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_ReplicateIADcreates a full copy and downloads all the data for that object from Salesforce. -
Do not try to
SF_Refreshtables created withSF_ReplicateIAD. Instead useSF_RefreshIAD. -
SF_ReplicateIADonly retrieves the deleted records that are currently in the Salesforce recycle bin. -
SF_ReplicateIADretains the permanently deleted rows from run to run. Once you begin to useSF_ReplicateIADfor a table, do not useSF_Replicateon the same table. If you runSF_Replicateinstead ofSF_ReplicateIAD, you lose all the permanently deleted rows in the local table.
Options
-
bulkapi—SF_ReplicateIADuses the Salesforce.com web services API by default. To use the Salesforce.com bulkAPI instead, add the optionalbulkapiswitch.SF_ReplicateIADthen 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_ReplicateIADuses 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_ReplicateIADuses the Salesforce web services API by default. To use the Salesforce BulkAPI with the pkchunking header instead, add the optionalpkchunkswitch.SF_ReplicateIADthen submits a BulkAPI job using the pkchunking header and polls for completion. Only use this option for large tables.For example, to use
pkchunkand poll for completion:EXEC SF_ReplicateIAD 'Salesforce','Account','pkchunk'The default batch size is 100,000. You can alter this using the
batchsizeparameter:EXEC SF_ReplicateIAD 'Salesforce','Account','pkchunk,batchsize(50000)' -
NoDrop—SF_ReplicateIADdrops the local table by default. To useSF_ReplicateIADwithout dropping the local table, add the optionalNoDropswitch.For example, to use
NoDropwithSF_Replicate:EXEC SF_ReplicateIAD 'Salesforce','Account','nodrop'