SF_Replicate


SF_Replicate


Usage

The SF_Replicate stored procedure creates a replicated table in the remote database of the remote SQL Server instance by using the contents of the corresponding object in Salesforce.com. The table uses the same name as the Salesforce.com object (for example, Account), and any schema changes in the Salesforce.com object are reflected in the replicated 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'

In this syntax:

  • The linked-server parameter specifies the name of your linked server.

  • The object-name parameter specifies the object name.

  • The options parameter can be either batchsize(n), pkchunk, or bulkapi (see Options for details). However, by default, this parameter is null.

  • The use-remote parameter specifies that you are targeting a database with this remote stored procedure. This parameter 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

The section describes options that you can use with the SF_Replicate stored procedure.

  • batchsize(n): SF_Replicate uses the maximum allowed batch size of 2000 rows. You might need to reduce the batch size to accommodate APEX code on the Salesforce.com server. To specify a different batch size, use the batchsize(n) option, as shown in this example:

    EXEC SF_Replicate 'Salesforce', 'Account', 'batchsize(50)', 1
    
  • pkchunk: By default, SF_Replicate uses the Salesforce Bulk API. If you want to use the Bulk API with the PK chunking header enabled, add the optional pkchunk switch. Use this option only for large tables, where chunking improves performance and reduces the likelihood of timeouts.

    The following example uses pkchunk, and it polls every minute for completion:

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

    The default batch size is 100,000. You change this value by using the batchsize(n) parameter, as shown in this example:

    EXEC SF_Replicate 'Salesforce','Account','pkchunk,batchsize(50000)', 1
    
  • bulkapi: By default, SF_Replicate uses the Salesforce.com Web Services API. To use the Salesforce Bulk API instead, add the optional bulkapi switch. When you specify this option, SF_Replicate submits a Bulk API job and polls every minute for completion. Use this option only for large tables, where the Bulk API can improve performance.

    The following example uses bulkapi, and it polls every minute for completion:

    EXEC SF_Replicate 'Salesforce','Account','bulkapi', 1
    

Notes

  • The SF_Replicate stored procedure creates a full copy of the Salesforce object and downloads all data for that object from Salesforce. When the table is replicated, DBAmp automatically creates a primary index on the ID column.

  • By default, DBAmp does not download the values of Base64 fields; instead, it sets those values to NULL. This behavior improves performance when you replicate large datasets. If you require the actual values, change the Include Binary Field Values setting to True on the Settings page of the DBAmp Configuration program.