# How to Insert excel data into database

**URL:** <https://forum.uipath.com/t/how-to-insert-excel-data-into-database/157308>\
**Category:** Help\
**Tags:** excel, database, activities\
**Created:** [October 8, 2019, 5:07am UTC](https://forum.uipath.com/t/how-to-insert-excel-data-into-database/157308 "2019-10-08T05:07:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![sudhasagar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sudhasagar/32/97359_2.png) [@sudhasagar](https://forum.uipath.com/u/sudhasagar)\
**Post date:** [October 8, 2019, 5:07am UTC](https://forum.uipath.com/t/how-to-insert-excel-data-into-database/157308/1 "2019-10-08T05:07:03Z")

</div>

Hi

I have an excel sheet contain data, using the read range activity store in a data table variable(vDT).  
Using this data table variable(vDT) trying to insert in the database.

 ![image](https://global.discourse-cdn.com/uipath/original/3X/e/1/e1c39786adffa1978387a55607228408eb5990f9.png)  
the above one I tried, got an error  
 ![image](https://global.discourse-cdn.com/uipath/original/3X/0/9/093ef434fc573f775d5901c56be74a46e5b5ddc3.png)

Please explain how can I work on it

---

<div class="post-metadata">

**Author:** ![sarathi125](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sarathi125/32/519448_2.png) [@sarathi125](https://forum.uipath.com/u/sarathi125)\
**Post date:** [October 8, 2019, 5:56am UTC](https://forum.uipath.com/t/how-to-insert-excel-data-into-database/157308/2 "2019-10-08T05:56:17Z")

</div>

Hi,

The column ‘MACHINERY’ may not be available in your database or check the datatype for the same column.

---

<div class="post-metadata">

**Author:** ![balupad14](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/balupad14/32/462142_2.png) [@balupad14](https://forum.uipath.com/u/balupad14)\
**Post date:** [October 8, 2019, 6:18am UTC](https://forum.uipath.com/t/how-to-insert-excel-data-into-database/157308/3 "2019-10-08T06:18:53Z")

</div>

Hi @sudhasagar,

Take a look this one with example.

> [@Insert SQL with variable / parameter giving error in ExecuteNonQuery activity](https://forum.uipath.com/t/insert-sql-with-variable-parameter-giving-error-in-executenonquery-activity/101739/8):
>
> Hi @ramawat, I made a test what @Pablo_Sanchez mentioned with a little table. It is working fine. can you attache the table script and your insert query as a zip file. May be it helps to do the analysis. But any way, Here I have attached xaml and table for your reference. [SqlServer.zip](https://global.discourse-cdn.com/uipath/original/3X/c/8/c87b8b0ed32608dfd357ae7145ae4b15257a6fd7.zip) (2.7 KB) Regards Balamurugan.S

Regards  
Balamurugan.S

---

<div class="post-metadata">

**Author:** ![diptojyotidutta](https://avatars.discourse-cdn.com/v4/letter/d/e0b2c6/32.png) [@diptojyotidutta](https://forum.uipath.com/u/diptojyotidutta)\
**Post date:** [October 8, 2019, 6:29am UTC](https://forum.uipath.com/t/how-to-insert-excel-data-into-database/157308/4 "2019-10-08T06:29:50Z")

</div>

Avoid using any Space or special characters for header names of the database table. Also ensure that header names in the excel sheet is same as that of the table in the database

---

<div class="post-metadata">

**Author:** ![sudhasagar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sudhasagar/32/97359_2.png) [@sudhasagar](https://forum.uipath.com/u/sudhasagar)\
**Post date:** [October 8, 2019, 9:19am UTC](https://forum.uipath.com/t/how-to-insert-excel-data-into-database/157308/5 "2019-10-08T09:19:59Z")

</div>

Hi  
The sequence of steps are missing in the work flow.  
So, please kindly explain in step by step process.  
The main object is read the excel and store in datatable variable and put this datatable variable in a database of sql

---

<div class="post-metadata">

**Author:** ![sudhasagar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/sudhasagar/32/97359_2.png) [@sudhasagar](https://forum.uipath.com/u/sudhasagar)\
**Post date:** [October 8, 2019, 9:22am UTC](https://forum.uipath.com/t/how-to-insert-excel-data-into-database/157308/6 "2019-10-08T09:22:12Z")

</div>

Hi,  
Actually, i want read the complete excel and store in a datatable variable.  
This Datatable variable should insert in a sql database.  
So,please explain in process of steps
