# tAzureSynapseOutput

Writes, updates, makes changes or suppresses entries in an Azure SQL Data Warehouse database.

## tAzureSynapseOutput Standard properties

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

The Standard tAzureSynapseOutput component belongs to two families: Cloud and Databases.

The component in this framework is available in all Talend products.

## Basic settings

| Properties | Description |
| --- | --- |
| 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><ol> <li> <p>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.</p> </li> <li> <p>In the child level, use a dedicated connection component to read                that registered database connection.</p> </li> </ol><br><br>Information noteWarning: If this component is<br>configured to perform operations to a table, it is strongly recommended that you<br>use an existing connection with the auto-commit function enabled for this<br>component. You can establish a connection of this type using the<br>tAzureSynapseConnection component, with the Auto Commit<br>option selected in the Advanced settings view. |
| Property Type | Select the way the connection details<br>will be set.<br><br><ul> <li> <p> <span>Built-In</span>: The connection details will be set                                locally for this component. You need to specify the values for all                                related connection properties manually.</p> </li> <li> <p> <span>Repository</span>: The connection details stored                                centrally in <span><span>Repository</span><abbr> &gt; </abbr><span>Metadata</span></span> will be reused by this component. </p> <p>You need to click                                the <span>[...]</span> button next to it and in the pop-up                                    <span>Repository Content</span> dialog box, select the                                connection details to be reused, and all related connection                                properties will be automatically filled in.</p> </li> </ul> |
| JDBC Provider | Select the provider of the JDBC driver to be used. |
| 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. |
| Schema | Enter the name of the Azure Synapse Analytics schema. |
| Database | Specify the name of the Azure Synapse Analytics to be used. |
| 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. |
| Table | Specify the name of the table to be used. |
| Action on table | Select an operation to be performed on the table defined.<br><br><ul> <li> <p> <span>Default</span>: No operation is carried out.</p> </li> <li> <p> <span>Drop and create table</span>: The table is removed            and created again.</p> </li> <li> <p> <span>Create table</span>: The table does not exist and            gets created.</p> </li> <li> <p> <span>Create table if does not exist</span>: The table is            created if it does not exist.</p> </li> <li> <p> <span>Drop table if exist and create</span>: The table is            removed if it already exists and created again.</p> </li> <li> <p> <span>Clear table</span>: The table content is            deleted. You have the possibility to rollback the operation.</p> </li> <li> <p> <span>Truncate</span>: The table content            is deleted.</p> </li> </ul> |
| Turn on identity insert | Select this checkbox to use your own sequence for the identity value of the<br>inserted records (instead of having the SQL Server pick the next sequential<br>value). |
| Action on data | Select an action to be performed on data of the table<br>defined.<br><br><ul> <li> <p> <span>Insert</span>: Add            new entries to the table. If duplicates are found, the Job stops.</p> </li> <li> <div> <span>Update</span>: Make            changes to existing                entries.<div><span>Information note</span><span>Note:</span> In cases where all the schema                columns are set as keys, this action yields an error and the Job fails.</div> </div> </li> <li> <div> <span>Insert or                update</span>: Insert a new record. If the record with the given reference            already exists, an update would be                made.<div><span>Information note</span><span>Note:</span> In cases where all the schema                columns are set as keys, this action yields a warning message and the Job                continues.</div> </div> </li> <li> <div> <span>Update or                insert</span>: Update the record with the given reference. If the record does            not exist, a new record would be                inserted.<div><span>Information note</span><span>Note:</span> In cases where all the schema                columns are set as keys, this action yields a warning message and the Job                continues.</div> </div> </li> <li> <p> <span>Delete</span>:            Remove entries corresponding to the input flow.</p> </li> <li> <p> <span>Insert if not                                  exist</span>: Add new entries to the table if they do not                              exist.</p> </li> </ul><br><br>It is necessary to specify at least one column as a primary<br>key on which the Update and<br>Delete operations are based. You<br>can do that by clicking Edit Schema<br>and selecting the check box(es) next to the column(s) you want to set as<br>primary key(s). For an advanced use, click the Advanced settings view where you can simultaneously define<br>primary keys for the Update and<br>Delete operations. To do that,<br>select the Use field options check<br>box and then in the Key in update<br>column, select the check boxes next to the column names you<br>want to use as a base for the Update<br>operation. Do the same in the Key in delete<br>column for the Delete operation.<br><br>The dynamic schema feature can be used in the following<br>modes: Insert, Update, Insert<br>or update, Update or<br>insert, and Delete. |
| Specify identity field | Select this checkbox to specify the identity field, which is made up of an<br>automatically incrementing identification number.<br><br>When this checkbox is selected, three other fields are displayed:<br><br><ul> <li> <p> <span>Identity                                        field</span>: select the column you want to define as                                    the identity field from the list.</p> </li> <li> <p> <span>Start                                        value</span>: type in a start value, used for the very                                    first row loaded into the table.</p> </li> <li> <p> <span>Step</span>: type                                    in an incremental value, added to the value of the previous row                                    that was loaded.</p> </li> </ul><br><br>This checkbox is available only when you select Drop and create<br>table, Create table, Create<br>table if not exists, or Drop table if exists and<br>create from the Action on table list ,<br>and will disappear if you select the Enable parallel<br>execution checkbox in the Advanced<br>settings view. If you select this checkbox with the<br>Turn on identity insert checkbox cleared and the<br>Create table if not exists option selected from the<br>Action on table list and if the specified table does<br>not exist, only a table will be created without inserting data into it.<br><br>Note that you can also specify the identity field from<br>the schema of the component. To do so, set the DB Type of the relevant column to<br>INT IDENTITY.<br><br>When the Specify identity field checkbox is selected,<br>the DB Type INT IDENTITY in the schema is ignored. |
| Schema and Edit schema | A schema is a row description. It defines the number of fields<br>(columns) to be processed and passed on to the next component. When you create a Spark<br>Job, avoid the reserved word line when naming the<br>fields.<br><br><ul> <li> <p> <span>Built-In</span>: You create and store the schema locally for this component                only.</p> </li> <li> <p> <span>Repository</span>: You have already created the schema and stored it in the                Repository. You can reuse it in various projects and Job designs.</p> </li> </ul><br><br>Click Edit schema to make changes to<br>the schema. If you make changes, the schema automatically becomes built-in.<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> |
| Specify a data source alias | Select this checkbox and in the<br>Data source alias field displayed, specify the alias of<br>a data source created on Talend Runtime<br>side to use the shared connection pool defined in the data source configuration.<br>This option works only when you deploy and run your Job in Talend Runtime.<br><br>This checkbox is not available when the Use an existing<br>Connection check box is selected. |
| Die on error | Select the checkbox to stop the execution of the Job when an error<br>occurs.<br><br>Clear the checkbox to skip any rows on error and complete the<br>process for error-free rows. |

## Advanced settings

| Properties | Description |
| --- | --- |
| Additional JDBC Parameters | Specify additional connection properties for the database<br>connection you are creating. The properties are separated by semicolon and<br>each property is a key-value pair. For example, *encrypt=true;trustServerCertificate=false;*<br>*hostNameInCertificate=\*.database.windows.net;loginTimeout=30;* for<br>Azure SQL database connection. |
| 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<br>requirements. |
| Commit every | Enter the number of rows to be completed before committing batches of rows<br>together into the database. This option ensures transaction quality (but not<br>rollback) and above all better performance on executions. |
| Additional Columns | This option is not offered if you create (with or without drop) the database<br>table. This option allows you to call SQL functions to perform actions on columns,<br>which are not insert, nor update or delete actions, or action that require<br>particular preprocessing.<br><br><ul> <li><span>Name</span>: Type in the name of the schema column to be                        altered or inserted as new column.</li> <li><span>SQL expression</span>: Type in the SQL statement to be                        executed in order to alter or insert the relevant column data.</li> <li><span>Position</span>: Select <span>Before</span>,                           <span>Replace</span> or <span>After</span> following                        the action to be performed on the reference column.</li> <li><span>Reference column</span>: Type in a column of reference that                        can be used to place or replace the new or altered column.</li> </ul> |
| Use field options | Select this checkbox to customize a request, especially when there is double<br>action on data. |
| Ignore date out of range | Select this checkbox to ignore the date validation and insert the data directly<br>into the database for the data types of DATE, DATETIME, DATETIME2, and<br>DATETIMEOFFSET. |
| Debug query mode | Select this check box to display each step during processing entries<br>in a database. |
| Support null in "SQL WHERE" statement | Select this checkbox if you want to deal with the Null values contained in a<br>database table.<br><br>Make sure that the Nullable checkbox is selected for the<br>corresponding columns in the schema. |
| Use Batch | Select this check box to activate the batch mode for data processing.<br><br>This checkbox is available only when you have selected the<br>Insert, the Update, the<br>Single Insert Query or the<br>Delete option in the Action on<br>data list.<br><br>Note that if you select the Single Insert Query option in the Action on data list, be aware that the<br>batch size must be lower than or equal to the limit of parameter markers<br>authorized by the JDBC driver (generally 2000) divided by the number of<br>columns. For more information, see related description in Limitation below. |
| Batch Size | Specify the number of records to be processed in each batch.<br><br>This field is available only when the Use batch mode<br>check box is selected. |
| tStatCatcher Statistics | Select this checkbox to gather the Job processing metadata at the Job level<br>as well as at each 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>Information noteWarning:<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 |
| --- | --- |
| ERROR\_MESSAGE | The error message generated by the component when an error<br>occurs. This is an After variable and it returns a string. |
| NB\_LINE | The number of rows processed. This is an After variable and<br>it returns an integer. |
| NB\_LINE\_UPDATED | The number of rows updated. This is an After variable and it<br>returns an integer. |
| NB\_LINE\_INSERTED | The number of rows inserted. This is an After variable and<br>it returns an integer. |
| NB\_LINE\_DELETED | The number of rows deleted. This is an After variable and it<br>returns an integer. |
| NB\_LINE\_REJECTED | The number of rows rejected. This is an After variable and<br>it returns an integer. |

## Usage

| Usage guidance | Description |
| --- | --- |
| Usage rules | This component is usually used as an end component of a Job or subJob and it<br>always needs an input link.<br><br>Information noteImportant: Microsoft SQL Server/JDBC encryption requirements<br><br>Starting with recent versions of the Microsoft SQL Server JDBC driver,<br>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). |
| Dynamic settings | Click the [+] button to add a row in the table<br>and fill the Code field with a context<br>variable to choose your database connection dynamically from multiple<br>connections planned in your Job. This feature is useful when you need to<br>access database tables having the same data structure but in different<br>databases, especially when you are working in an environment where you<br>cannot change your Job settings, for example, when your Job has to be<br>deployed and executed independent of Talend Studio.<br><br>The Dynamic settings table is<br>available only when the Use an existing<br>connection check box is selected in the Basic settings view. Once a dynamic parameter is<br>defined, the Component List box in the<br>Basic settings view becomes unusable.<br><br>For examples on using dynamic parameters, see [Reading data from databases through<br>context-based dynamic connections](https://help.qlik.com/talend/r/en-US/8.0/components/defining-context-groups/reading-data-from-databases-through-context-based-dynamic-connections) and [Reading data from different MySQL databases<br>using dynamically loaded connection parameters](https://help.qlik.com/talend/r/en-US/8.0/components/context/reading-data-from-different-mysql-databases-using-dynamically-loaded-connection-parameters). For more information on<br>Dynamic settings and context variables, see<br>[Dynamic schema](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/dynamic-schema) and [Creating a context group and define context<br>variables in it](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/creating-context-group-and-define-context-variables-in-it). |
| Limitation | When the Single Insert Query option is selected<br>in the Action on data list, an<br>SQL Prepared Statement is generated, for example, INSERT INTO table (col1, col2, col3) VALUES (?,?,?)<br>, (?,?,?) , (?,?,?) ,(?,?,?). Within brackets are the<br>groups of parameters the number of which cannot exceed 2000, generally,<br>depending on the JBDC driver. Therefore, the batch size should be set so<br>that this limit is respected.<br><br>Note that some<br>features that are supported by other databases are not supported by<br>Azure Synapse Analytics. For more information, see [Unsupported table<br>features](https://docs.microsoft.com/en-us/azure/sql-data-warehouse/sql-data-warehouse-tables-overview#unsupported-table-features).<br><br>Also note that when creating or deleting a table with<br>this component, it is recommended to use the auto commit function by reusing<br>the database connection created by a<br>tAzureSynapseConnection component and selecting the<br>Auto Commit checkbox on the Advanced<br>settings view of the<br>tAzureSynapseConnection component, instead of using a<br>tAzureSynapseCommit component. |