> For the complete documentation index, see [llms.txt](https://documentation.astera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.astera.com/astera-data-stack-v6/dataflows/sources/sql-query-source.md).

# SQL Query Source

SQL Query Source enables you to retrieve data from database using a SQL query or a stored procedure. You can specify any valid SELECT statement or a stored procedure call as query. In addition, you can parameterize your queries dynamically changing values of the parameters at runtime.

{% embed url="<https://youtu.be/n8zF1hHuU0o>" %}

## **Steps**

Adding a *SQL Query Source* object allows you to transfer data returned by the SQL query. An example of what an SQL Query source object looks like is shown below.

![](/files/PR3Bcz5uZILjGKJIjNSD)

To configure the properties of a *SQL Query Source* object after it was added to the dataflow, right-click on it and select *Properties* from the context menu. The following properties are available:

* *Source Connection screen* – allows you to enter the connection information for your SQL Query, such as server name, database and schema, as well as credentials for connecting to the selected database.
* *SQL Query Source screen:* Enter the SQL expression controlling which records should be returned by this source. The expression should follow SQL syntax conventions for the chosen database provider.

For example, *select OrderId, OrderName, CreatedDtTm from Orders.*


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://documentation.astera.com/astera-data-stack-v6/dataflows/sources/sql-query-source.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.
