# 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.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/WUxvc6zo4z4QIR6dtbMx/3.png)

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.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/YNoHjUXF3gv1Q1XP7ygP/4.png)

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.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/tzb6HhZlSHO7eOezQhUK/5.png)

*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.

![](https://content.gitbook.com/content/zEifS4h8yurLAAwiGNX2/blobs/GvN1wcD8aYdQD4vW2lGM/6.png)

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