Azure Synapse SQL - Execute
In this article
Overview
You can use this Snap to execute Transact-SQL queries.
This Snap works only with single queries.
Snap Type
The Azure Synapse SQL - Execute Snap is a Write-type Snap that writes the results of the executed SQL queries.
Prerequisites
Valid Azure Synapse SQL Account.
Access to Azure Synapse SQL and the required permissions to execute T-SQL queries.
Support for Ultra Pipelines
Works in Ultra Pipelines.
Limitations
Known Issues
This Snap fails to insert null values for date data types, because of an issue with the jOOQ auto cast() expression in the transformed query.
Snap Views
Type | Format | Number of Views | Examples of Upstream and Downstream Snaps | Description |
---|---|---|---|---|
Input | Document |
|
| If the input view is defined, then the where clause substitutes incoming values for a specific query. |
Output | Document
|
|
| If an output view is available and an update/insert/merge/delete statement was executed, then the original document that was used to create the statement will be output with the status of the executed statement. |
Error | Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter when running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab:
Learn more about Error handling in Pipelines. |
Snap Settings
Asterisk ( * ): Indicates a mandatory field.
Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.
Expression icon ( ): Indicates the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.
Add icon ( ): Indicates that you can add fields in the field set.
Remove icon ( ): Indicates that you can remove fields from the field set.
Field Name | Field Type | Description |
---|---|---|
Label*
Default Value: Azure Synapse SQL - Execute | String | Specify a unique name for the Snap.
|
SQL Statement*
Default Value: | String/Expression | Specify the SQL statement to execute on the server. We recommend you to add a single query in the SQL Statement field. There are two possible scenarios that you encounter when working with SQL statements in SnapLogic. Scenarios to successfully execute your SQL statements Scenario 1: Executing SQL statements without expressions.
Additionally, the JSON path is allowed only in the WHERE clause. If the SQL statement starts with SELECT (case-insensitive), the Snap regards it as a select-type query and executes once per input document. Else, it regards it as write-type query and executes in batch mode. Scenario 2: Executing SQL queries using expressions.
|
Query type
Default Value: Auto | Dropdown list/Expression | Select the type of query for your SQL statement (Read or Write). When Auto is selected, the Snap tries to determine the query type automatically. |
Ignore empty result
Default value: Deselected | Checkbox
| Select this checkbox to enable the Snap to ignore empty result and not write a document to the output view when a SELECT operation does not produce any result. |
Number of Retries
Default Value: 0 | Integer/Expression | Specify the maximum number of retry attempts the Snap must make in case there is a network failure and is unable to read the target file. The request is terminated if the attempts do not result in a response.
|
Retry Interval (Seconds) Default Value: 1 | Integer/Expression | Specify the time interval between two successive retry requests. A retry happens only when the previous attempt resulted in an exception.
|
Auto Commit Default value: Use account setting | Dropdown list | Select one of the following options to override the state of Auto commit on the account:
|
Snap Execution Default Value: Validate & Execute | Dropdown list | Select one of the three modes in which the Snap executes. Available options are:
|
Troubleshooting
Error | Reason | Resolution |
---|---|---|
| This error is because of an issue with the | Use the CONCAT reference for each value to run the query. |
Example
Fetch employee records from the employee table
This example Pipeline demonstrates how to fetch employee records from the Employee table.
Step 1: Configure the Azure Synapse SQL - Execute Snap with a SELECT query that reads all employee records from the “dbo.Employee” table.
On validation, this Snap generates the output that lists all the objects associated with Employee records.
Step 2: Configure the JSON Formatter Snap to read the input document and generate binary output.
Step 3: Configure the File Writer Snap to write the employee.json file into the SL database.
On validation, the employee.json file is generated:
Downloads
Snap Pack History
Related Content
Have feedback? Email documentation@snaplogic.com | Ask a question in the SnapLogic Community
© 2017-2024 SnapLogic, Inc.