# Can i use UI Path in executing sql files?

**URL:** <https://forum.uipath.com/t/can-i-use-ui-path-in-executing-sql-files/65993>\
**Category:** Help\
**Tags:** database, activities\
**Created:** [September 20, 2018, 6:12am UTC](https://forum.uipath.com/t/can-i-use-ui-path-in-executing-sql-files/65993 "2018-09-20T06:12:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paolomondelo](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@paolomondelo](https://forum.uipath.com/u/paolomondelo)\
**Post date:** [September 20, 2018, 6:12am UTC](https://forum.uipath.com/t/can-i-use-ui-path-in-executing-sql-files/65993/1 "2018-09-20T06:12:15Z")

</div>

Can i use UI Path in executing sql files ?

---

<div class="post-metadata">

**Author:** ![PrankurJoshi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/prankurjoshi/32/37212_2.png) [@PrankurJoshi](https://forum.uipath.com/u/PrankurJoshi)\
**Post date:** [September 20, 2018, 7:40am UTC](https://forum.uipath.com/t/can-i-use-ui-path-in-executing-sql-files/65993/2 "2018-09-20T07:40:36Z")

</div>

Hi @paolomondelo,

Yes of course you can, have a look here

> **[How to query data from a SQL database](https://www.uipath.com/kb-articles/how-to-query-data-from-sql-database)**
>
> How to query data from SQL database. UiPath. Automate rule based business and IT processes. Train and design robots that drive the user interface like a human.

Do not forget to add Database Activities package

> **[About the Database Activities Package](https://docs.uipath.com/activities/docs/about-the-database-activities-pack)**
>
> The Database Activities Pack enables the user to connect to a database and perform an entire palette of actions within it, such as executing transactions or queries and non queries. It can be used to connect to a large selection of databases, such as...

Thanks,  
Prankur

---

<div class="post-metadata">

**Author:** ![paolomondelo](https://avatars.discourse-cdn.com/v4/letter/p/5daacb/32.png) [@paolomondelo](https://forum.uipath.com/u/paolomondelo)\
**Post date:** [September 24, 2018, 4:44am UTC](https://forum.uipath.com/t/can-i-use-ui-path-in-executing-sql-files/65993/3 "2018-09-24T04:44:15Z")

</div>

I mean like can i just simply call a file called Test123.sql and execute it? I knpw the execute query function of ui path simply executes an sql statement and not the sql file itself.

---

<div class="post-metadata">

**Author:** ![Adam\_Hanson](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/adam_hanson/32/176697_2.png) [@Adam\_Hanson](https://forum.uipath.com/u/Adam_Hanson)\
**Post date:** [November 9, 2018, 3:38pm UTC](https://forum.uipath.com/t/can-i-use-ui-path-in-executing-sql-files/65993/4 "2018-11-09T15:38:34Z")

</div>

I’m looking into this myself.

---

<div class="post-metadata">

**Author:** ![Florent\_Salendres](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/florent_salendres/32/74617_2.png) [@Florent\_Salendres](https://forum.uipath.com/u/Florent_Salendres)\
**Post date:** [November 11, 2018, 10:48am UTC](https://forum.uipath.com/t/can-i-use-ui-path-in-executing-sql-files/65993/5 "2018-11-11T10:48:12Z")

</div>

Hi,  
This type of expression is doing the trick

`File.ReadAllText("myfile.sql")`

Read Text File activity should work as well.

Cheers
