Skip to main content
manages all transformations in a declarative manner by using a special purpose SQL command: REPLICATE. The REPLICATE command enables you to define the data that is selected and the transformations that are applied as well as to map the data to a destination table.
The application contains a full SQL-92-compliant engine that dynamically translates standard SQL queries into the source API calls.
REPLICATE Syntax:
The REPLICATE command supports additional options through the WITH clause that control how data is processed during replication. Some options affect execution behavior rather than transformations. For example, you can enable parallel partitioned reads to improve snapshot performance for large datasets. For more information, see Snapshot Performance with Parallel Partitioned Reads.

Common REPLICATE Tasks

This section provides examples for several common REPLICATE tasks.

Maintain a Copy of a Table in Your Destination

If you want to maintain a copy of a table in your destination, you can use the following REPLICATE command:
This REPLICATE command creates a table in the destination database if it does not already exist. If applicable, the REPLICATE statement retrieves recent changes (newly updated and inserted records in the source) and applies them to the destination.

Replicate One Table from Another Table

You can use the following command to replicate one table from another table (in this case, replicating REP_Table from Table).

Select Columns and Perform Operations on Data before Replication

To select specific columns and perform operations on data before it is replicated, you can use the following REPLICATE command:
This command creates the table REP_Table with the columns DateModified and FullName. The FullName column is a concatenation of FirstName and LastName from the Table table.

Replicating Tables in a Destination with and without a Primary Key

You can customize how creates tables in your destination by redefining columns in the REPLICATE statement. This approach allows you to control whether to include or omit primary keys when a table is created in a destination. To create a destination table without a primary key, even when one exists in the source, you can explicitly define the column without the PRIMARY KEY keyword in the column definition, as shown in this syntax:
For example, to create a table named Airlines without the Id column as a primary key, submit this command:
To define a primary key in the destination, even when one does not exist in the source, use the same syntax but include the PRIMARY KEY keyword in the column definition, as shown here:

Using Variables in REPLICATE Queries

You can reference dynamic values in REPLICATE queries by using variable syntax. supports two types of variables: environment variables and pipeline variables.
  • Environment variables: You set these variables in a pre-job event script. Use the syntax {env:variablename}, as shown in this example:
    For more information, see Creating Environment Variables and Using Environment Variables in the REPLICATE Query.
  • Pipeline variables: These variables are available when a job runs as part of a pipeline. Use the syntax {pipeline:variablename}, as shown in this example:
    For more information, see Using Pipeline Variables.