# Run SQL File Task

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

<figure><img src="https://750977703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqHxyVNGb7tSdIWecl6Ru%2Fuploads%2FdT0FAYZ4lCk5GPA3shVL%2Fimage.png?alt=media&#x26;token=a9b09d39-8a4b-49d1-b263-198d404e1279" alt=""><figcaption></figcaption></figure>

To use a *Run* *SQL* *File* task:

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

<figure><img src="https://750977703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqHxyVNGb7tSdIWecl6Ru%2Fuploads%2Fyd6K5wfilzB5cXEOwc7s%2Fimage.png?alt=media&#x26;token=20b946a8-9241-466a-ba00-7349b931e88f" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://750977703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqHxyVNGb7tSdIWecl6Ru%2Fuploads%2F8BhkcPwfGYAC3Mt92pBe%2Fimage.png?alt=media&#x26;token=84573c61-03b4-4a94-83f7-1cfcf80de306" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://750977703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqHxyVNGb7tSdIWecl6Ru%2Fuploads%2Fwf05BvNDYabCCwMn6WZD%2Fimage.png?alt=media&#x26;token=1d3bb8fb-04bf-42c6-9a7e-b8d3c41c164b" alt=""><figcaption></figcaption></figure>

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.

<figure><img src="https://750977703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqHxyVNGb7tSdIWecl6Ru%2Fuploads%2FBJy6EiclWkKlWSU09A8O%2Fimage.png?alt=media&#x26;token=9516edfe-9d33-4b65-b634-65664974f925" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://750977703-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqHxyVNGb7tSdIWecl6Ru%2Fuploads%2FCdtVaeP09uFCK99tQsFI%2Fimage.png?alt=media&#x26;token=ba16f555-9953-4ddb-bc6f-660b904e010b" alt=""><figcaption></figcaption></figure>

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