> 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/workflows/run-sql-file.md).

# Run SQL File

The *Run SQL File* task runs the SQL code inside a file of .sql extension as part of a workflow.

<figure><img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/lYvCnUvI9niddLpWFxiS/1.png" alt=""><figcaption></figcaption></figure>

To use a *Run* *SQL* *File* task, drag-and-drop the *Run SQL File* task object onto the workflow designer. Configure the object by right-clicking on the object’s header and selecting *Properties* from the context menu.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/fZqZ99BlCERZjG8tHyjb/2.png)

A *Database Connection* window will open, as shown below. This is where we will configure a connection with the database.

<img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/WUxvc6zo4z4QIR6dtbMx/3.png" alt="" width="563">

Astera offers native connectivity to several databases and applications. To connect to a database, click on the drop-down menu next to the *Data Provider* field and select a data provider from the list.

<img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/YNoHjUXF3gv1Q1XP7ygP/4.png" alt="" width="563">

To establish a connection to a data provider, fill in the credentials, which are *User Id*, *Password*, *Server Name*, *Database*, and *Schema* for SQL Server.

Next is the *Run Sql File Properties* window.

<img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/tzb6HhZlSHO7eOezQhUK/5.png" alt="" width="563">

*SQL File Path*: Specify the path to the SQL file that you want to execute through this task.

Next is the *Config Parameters* screen. This is where users can set up variable parameters to indicate a run-time change for values in the list on the screen.

<img src="https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/GvN1wcD8aYdQD4vW2lGM/6.png" alt="" width="563">

Click *OK* to close the window. You can now execute this task as part of the workflow.

This concludes the configuration and working of the *Run SQL File* workflow task in Astera.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.astera.com/workflows/run-sql-file.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
