# tMSSqlCDC

Extracts the changes made to the source operational data and makes them available to the target system(s) using database CDC views.

tMSSqlCDC extracts source system data that has changed since the last extraction and transports it to another/other system(s).

Information noteNote: If batch processing is enabled in the Job, the component cannot capture the order of changes and the source and target databases will not be synchronized.

## tMSSqlCDC Standard properties

These properties are used to configure tMSSqlCDC running in the Standard Job framework.

The Standard tMSSqlCDC component belongs to the Databases family.

The component in this framework is available in all subscription-based Talend products.

Information noteNote: This component is a specific version of a dynamic database connector. The properties related to database settings vary depending on your database type selection. For more information about dynamic database connectors, see [DB Generic components](https://help.qlik.com/talend/r/en-US/8.0/components/db-generic/db-generic-component).

## Basic settings

| Properties | Description |
| --- | --- |
| Database | Select the desired database type from the list and click<br>Apply. |
| Use an existing connection | Select this check box and in the Component<br>List drop-down list, select the desired connection component to<br>reuse the connection details you already defined.<br><br>Information noteNote: When a Job contains the parent Job and the child Job, do the following if you<br>want to share an existing connection between the parent Job and the child Job (for example,<br>to share the connection created by the parent Job with the child Job).<br><br><ol> <li>In the parent level, register the database connection to be shared               in the <span>Basic settings</span> view of the               connection component which creates that very database connection. </li> <li>In the child level, use a dedicated connection component to read               that registered database connection. </li> </ol><br><br>For an example about how to share a database connection across Job levels,<br>see [Sharing a database connection](https://help.qlik.com/talend/r/en-US/7.3/studio-user-guide/sharing-database-connection). |
| Property type | Either Built-in or Repository.<br><br><ul> <li> <span>Built-in</span>: No property data stored                        centrally.</li> <li> <span>Repository</span>: Select the repository                        file in which the properties are stored. The fields that follow are                        completed automatically using the data retrieved.</li> </ul><br><br>Information noteWarning: Reset the DB type by clicking the<br>relevant button to select the CDC connection. |
| JDBC Provider | Select the provider of the JDBC driver to be used, either Microsoft (the default, recommended) or Open<br>source JTDS.<br><br>When Microsoft is selected, you need to download the<br>Microsoft JDBC Driver for SQL Server on [Microsoft Download<br>Center](https://www.microsoft.com/en-us/download/details.aspx?id=11774), unpack the downloaded zip file, choose a jar in the<br>unzipped folder based on your JRE version, rename the jar to *mssql-jdbc.jar* and install it manually. For more<br>information about choosing the jar, see the System Requirements<br>information on [Microsoft Download<br>Center](https://www.microsoft.com/en-us/download/details.aspx?id=11774).<br><br>When using this component with Datasource in Talend Runtime, you need<br>to use the Open source JTDS driver. |
| Host | Enter the IP address or the hostname of the database server or the Azure Synapse<br>Analytics to be used.<br><br>If the SQL Server Browser service is running on the<br>machine where the server resides, you can connect to a named instance through a<br>TCP dynamic port by providing the host name and the instance name in this field<br>in the format of {host\_name}\{instance\_name}. In this<br>case, you can leave the Port field empty. See [SQL Server Browser service](https://docs.microsoft.com/en-us/sql/tools/configuration-manager/sql-server-browser-service?view=sql-server-ver16) for related<br>information. |
| Port | Enter the listening port number of the database server or the Azure Synapse<br>Analytics to be used.<br><br>If the SQL Server Browser service is running on the<br>machine where the server resides, you can connect to a named instance through a<br>TCP dynamic port by providing the host name and the instance name in the<br>Host field and leave this field empty. See [SQL Server Browser service](https://docs.microsoft.com/en-us/sql/tools/configuration-manager/sql-server-browser-service?view=sql-server-ver16) for related<br>information. |
| Database | Enter the name of the database. |
| Schema | Enter the name of the schema. |
| Username and<br>Password | Enter the authentication data.<br><br>To enter the password, click the<br>[...] button next to the<br>Password field, enter the password in double<br>quotes in the pop-up dialog box, and then click<br>OK.<br><br>You can use<br>Type 2 integrated authentication on<br>Windows by adding<br>integratedSecurity=true in the<br>Additional JDBC Parameters field and leave<br>these two fields empty. See section *Connecting with integrated<br>authentication On Windows* at [Building the connection URL](https://docs.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?redirectedfrom=MSDN) for related<br>information. |
| Schema using CDC and Edit Schema | A schema is a row description, it defines the number of fields to be<br>processed and passed on to the next component. The schema is either Built-in or stored remotely in the Repository.<br><br><br>Built-In: You create and store the schema locally for this component<br>only.<br><br><br>Repository: You have already created the schema and stored it in the<br>Repository. You can reuse it in various projects and Job designs.<br><br>Information noteWarning: Reset the DB type by clicking the<br>relevant button to select the schema of the CDC connection.<br><br>Click Edit<br>schema to make changes to the schema. If the current schema is of the Repository type, three options are available:<br><br><ul> <li> <p> <span>View schema</span>: choose this                option to view the schema only.</p> </li> <li> <p> <span>Change to built-in property</span>:                choose this option to change the schema to <span>Built-in</span> for local changes.</p> </li> <li> <p> <span>Update repository connection</span>:                choose this option to change the schema stored in the repository and decide whether                to propagate the changes to all the Jobs upon completion.</p> <p>If you just want to                propagate the changes to the current Job, you can select <span>No</span> upon completion and choose this schema metadata                again in the <span>Repository Content</span>                window.</p> </li> </ul> |
| Table name | Select the source table from which changes made to data are to be captured. |
| Subscriber | Enter the name of the application that will use the change table. |
| Events to catch | <ul> <li> <span>Insert</span>: Select this check box to                        catch the data inserted in the change table since the last extraction.</li> <li> <span>Update</span>: Select this check box to                        catch the data updated in the change table since the last extraction.</li> <li> <span>Delete</span>: Select this check box to                        catch the data deleted in the change table since the last extraction.</li> </ul> |
| Limit | Maximum number of consumed rows a subscriber can recover from the change<br>table, per execution. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Additional JDBC parameters | Specify additional connection properties for the DB connection you are<br>creating. This option is not available if you have selected the Use an existing connection checkbox in the<br>Basic settings. |
| Authenticate using Azure Active<br>Directory | When selected, this option allows you to pick the authentication mode to use<br>from the Azure Active Directory authentication mode<br>dropdown list:<br><br><ul> <li><span>Service principal (client secret)</span>: use the service                        principal credentials (client ID and client secret) to authenticate.</li> <li><span>User password</span>: use the Azure Active Directory user                        credentials (username and password) to authenticate.</li> </ul><br><br>Read the Usage section of this document for<br>information about Microsoft SQL Server/JDBC encryption requirements.<br><br>This option is only available when<br>Microsoft is selected from the JDBC<br>Provider dropdown list in the Basic<br>settings view. |
| Keep data in CDC Table | Select this checkbox to retain changes in the CDC table, allowing one or<br>more target systems to consult the data even after ingestion. When enabled, this<br>option prevents deletion of the consulted CDC data; instead, it updates the value<br>of the field CDC\_STATE to 'x'. This mechanism<br>lets users recheck previously ingested data by filtering records where<br>CDC\_STATE = 'x' (for example, using a<br>tMysqlInput component), and manage deletion themselves if needed. This option is<br>especially useful for users who need to audit or revisit ingested data without<br>having to re-run Jobs or reverse-engineer the process to understand how the<br>checkbox affects CDC\_STATE. |
| Trim all the String/Char columns | Select this checkbox to delete any spaces found at the beginning or end of<br>fields, in all of the columns containing character strings. |
| Trim column | Remove leading and trailing whitespace from defined columns.<br><br>Information noteNote: Clear Trim all the String/Char<br>columns to enable Trim columns in this field. |
| tStatCatcher Statistics | Select this checkbox to collect log data at a component level. |
| Enable parallel execution | Select this check box to perform high-speed data processing, by treating<br>multiple data flows simultaneously. Note that this feature depends on the database or<br>the application ability to handle multiple inserts in parallel as well as the number of<br>CPU affected. In the Number of parallel executions<br>field, either:<br><br><ul> <li>Enter the number of parallel executions desired.</li> <li>Press <span>Ctrl+Space</span> and select               the appropriate context variable from the list. For further information about context               variables, see <a href="https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables" target="_blank">Using contexts and variables</a>. </li> </ul><br><br>Note that when parallel execution is enabled, it is not possible to use global<br>variables to retrieve return values in a subJob.<br><br><ul><li>						            The <span>Action on							table</span> field is not available with the							parallelization function. Therefore, you must use a <span>tCreateTable</span> component if you							want to create a table. 					          </li><li>						            When parallel execution is enabled, it is not							possible to use global variables to retrieve return values in a							subJob.					          </li> </ul> |

## Global Variables

| Variables | Description |
| --- | --- |
| Global Variables | NB\_LINE:<br>the number of rows processed. This is an After variable and it returns an integer.<br><br><br>ERROR\_MESSAGE: the error message generated by the<br>component when an error occurs. This is an After variable and it returns a string. This<br>variable functions only if the Die on error checkbox is<br>cleared, if the component has this checkbox.<br><br>A Flow variable functions during the execution of a component<br>while an After variable functions after the execution of the component.<br><br>To fill up a field or expression with a variable, press Ctrl+Space to access the variable list and choose the variable to use from<br>it.<br><br>For more information about variables, see [Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables). |

## Usage

| Usage guidance | Description |
| --- | --- |
| Usage rules | This component is used as a start component. It requires an output component<br>and row Main link.<br><br>Information noteImportant: Microsoft SQL Server/JDBC encryption<br>requirements<br><br>Starting with recent versions of the Microsoft SQL Server JDBC<br>driver, TLS encryption is enabled by default<br>(encrypt=true;trustServerCertificate=false). This<br>enhances security, but if your SQL Server does not support encrypted<br>connections or does not require clients to use TLS, you must set<br>encrypt=false in the JDBC parameters of this component<br>to connect successfully.<br><br><ul> <li> <p>For production or cloud environments using certificates signed by a                              trusted authority (e.g., Azure, AWS), no changes are needed, the                              default settings will work. </p> </li> <li> <p>For servers using self-signed certificates, use                                 <span>encrypt=true;trustServerCertificate=true</span> or                              specify the trust store details                                 (<span>encrypt=true;trustStore=&lt;your_trust_store&gt;;trustStorePassword=&lt;your_trust_store_password&gt;</span>).                           </p> </li> <li> <p>For non-secure development or test servers, set                                 <span>encrypt=false</span> in the additional JDBC parameters.                           </p> </li> </ul><br><br>For more information on how to use connections with encryption<br>properties, see [Microsoft SQL JDBC documentation](https://learn.microsoft.com/en-us/sql/connect/jdbc/connecting-with-ssl-encryption?view=sql-server-ver17). |