# Run SQL File Task

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

![](https://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2Fj2Ho7d6Kc1ogWSQaYWMY%2F0.png?alt=media)

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.

![](https://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FEH9FSAszZozhAP5L7JTt%2F1.png?alt=media)

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

![](https://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2FhYLgzoHXB0KJ4uy4TUnS%2F2.png?alt=media)

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.

![](https://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2Fa6jNfVhofwQCCkW5Iynz%2F3.png?alt=media)

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://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2Fe9Fr7SgWlj6MdTLFJq9Z%2F4.png?alt=media)

*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://3891069449-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F28dJIkGHacXhBlux3efx%2Fuploads%2F3dZ7Ef20SBFaSqMfdbDA%2F5.png?alt=media)

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