When you call the ConfigureSubscriptionInstance operation, you must specify the SubscriptionObjects parameter. This topic provides the definition and examples of the SubscriptionObjects parameter.

Definition of the SubscriptionObjects parameter

The value of the SubscriptionObjects parameter is an array of JSON objects. Regular expressions are supported. The following script shows the parameter definition.

[{
    "DBName":"The name of the database from which you want to track data changes",
    "TableIncludes": [{
        "TableName":"The name of the table from which you want to track data changes",
    }],
    "TableExluces": [{
        "TableName": "The name of the table that you want to exclude from the change tracking task",
    }]
}]

Configuration examples

Example 1: Track data changes from all tables in the dtstestdata database.

[{
    "DBName": "dtstestdata"
}]

Example 2: Track data changes from all tables in the dtstestdata and mysqltest database.

[{
    "DBName": "dtstestdata"
},{
    "DBName": "mysqltest"
}]

Example 3: Track data changes from the customer and order tables in the dtstestdata database.

[{
    "DBName": "dtstestdata",
    "TableIncludes": [{
        "TableName": "customer"
    }, {
        "TableName": "order"
    }]
}]

Example 4: Track data changes from all tables in the dtstestdata database except the tables whose names are prefixed with "order."

[{
    "DBName": "dtstestdata",
    "TableExcludes": [{
        "TableName": "order.*"
    }]
}]

Supported regular expressions

Symbol Description
Period (.) Matches any single character except '\r\n'.
Asterisk (*) Matches zero or more repetitions of the preceding sub-expression. For example, h.*llo matches strings such as hllo and heeeello.
Question mark (?) Matches zero or one repetition of the preceding sub-expression. For example, h.?llo matches hllo and hello, but not haello.
Character set [characters] Matches any single character included in the brackets. For example, h[ae]llo matches hallo and hello.
Negative character set [^characters] Matches any single character except the characters included in the brackets. For example, h[ae]llo matches hcllo or hdllo, but not hallo or hello.
Character range [character1-character2] Matches any characters within the range from character1 to character2, for example, [0-9] and [a-z].