SF_Replicate


SF_Replicate


Usage

SF_Replicate creates a replicated table in the remote database of the remote SQL Server Instance with the contents of the same object at Salesforce.com. The name of the table is the same name as the Salesforce.com object (e.g., Account). Any schema changes in the object at Salesforce.com are reflected in the new table.

In addition, SF_Replicate creates a primary key on the ID field of the table.

Syntax

EXEC SF_replicate 'linked_server','object_name','options', 'use_remote'

where linked_server is your linked server name, and object_name is the object name. Use_remote must be set to 1.

Example

The following example replicates the Account table with the current data on Salesforce.com to the remote database of the remote SQL Server Instance. EXEC SF_replicate ‘Salesforce’, ‘Account’, ‘’, 1

Options

batchsize: SF_Replicate uses the maximum allowed batch size of 2000 rows. You may need to reduce the batch size to accommodate APEX code on the Salesforce.com server. To specify a different batch size, use the batchsize(xx) option. For example, to set the batch size to 50:

EXEC SF_Replicate 'Salesforce','Account','batchsize(50)', 1

pkchunk: SF_Replicate uses the Salesforce.com web services API by default. To use the Salesforce.com bulkAPI with the pkchunking header instead, add the optional pkchunk switch. SF_Replicate submits a bulkAPI job using the pkchunking header and polls every minute for completion. You should only use this option for large tables.

For example, to use pkchunk and poll every 1 minutes for completion:

EXEC SF_Replicate 'Salesforce','Account','pkchunk', 1

The default batch size is 100,000. You can alter this using the batchsize parameter:

EXEC SF_Replicate 'Salesforce','Account','pkchunk,batchsize(50000)', 1

bulkapi: SF_Replicate uses the Salesforce.com web services API by default. To use the Salesforce.com bulkAPI instead, add the optional bulkapi switch. SF_Replicate submits a bulkAPI job and polls every minute for completion. You should only use bulkapi for large tables. For example, to use the bulkAPI and poll every 1 minutes for completion:

EXEC SF_Replicate 'Salesforce','Account','bulkAPI', 1

Notes

• SF_Replicate creates a full copy and downloads all the data for that object from Salesforce. A primary index on the ID column is automatically created when the table itself is replicated. • By default, DBAmp does not download the values of Base64 fields but instead sets the value to NULL. This is done for performance reasons. If you require the actual values, change the Include Binary Field Values setting to True in the “Settings” page of the DBAmp Configuration program.