# Azure SQL

The **Azure SQL Node** is a workflow node that allows you to query an Azure SQL database using either plain English or SQL queries. This node is ideal for retrieving, analyzing, and interacting with your database data directly within your workflow, making data access seamless and user-friendly.

***

**How to use it?**

To use the Azure SQL node, you must provide two required inputs:

1. **Schema**: Describe your database schema, including tables, columns, and data types.
2. **Query**: Enter your question or request in plain English or as a SQL statement.

The node will process your input, convert plain English queries to SQL if needed, execute the query, and return the results.

***

**Example of Usage**

Suppose you have a table called `Sales` with columns `CustomerName`, `OrderAmount`, and `OrderDate`.

* **Schema (Required):**

  ```
  TABLE Sales (
    CustomerName TEXT,
    OrderAmount REAL,
    OrderDate DATE
  );
  ```
* **Query (Required):**

  ```
  What is the total order amount for 2024?
  ```

  or

  ```
  SELECT SUM(OrderAmount) FROM Sales WHERE YEAR(OrderDate) = 2024;
  ```

**Outputs:**

* **Query (Required):** The SQL query that was executed (e.g., `SELECT SUM(OrderAmount) FROM Sales WHERE YEAR(OrderDate) = 2024;`)
* **Results (Required):** The results of the query (e.g., `{"SUM(OrderAmount)": 150000}`)

***

**Available Actions**

* **Query an Azure SQL database**
  * **Inputs:**
    * **Schema** (Required): The structure of your database (tables, columns, types, etc.).
    * **Query** (Required): Your question in plain English or a SQL statement.
  * **Configurations:** None required beyond the schema and query.
  * **Outputs:**
    * **Query**: The SQL query that was executed.
    * **Results**: The results returned from the database.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.stackai.com/workflow-builder/apps/azure-sql.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
