# Can't insert data into database table

**URL:** <https://forum.uipath.com/t/cant-insert-data-into-database-table/146491>\
**Category:** Help\
**Tags:** database, uiautomation, activities\
**Created:** [August 30, 2019, 4:27am UTC](https://forum.uipath.com/t/cant-insert-data-into-database-table/146491 "2019-08-30T04:27:42Z")\
**Posts on this page:** 7\
**Page:** 1

<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:** [August 30, 2019, 4:27am UTC](https://forum.uipath.com/t/cant-insert-data-into-database-table/146491/1 "2019-08-30T04:27:42Z")

</div>

![image](https://global.discourse-cdn.com/uipath/original/3X/3/e/3e4c16e2560d767e968e005627759db7c02b68ee.png)  
I am using data scraping and have assigned each row of the datatable which i have got from the sacraping of a website to a variable. The picture shown above is showing all the variable names that i am using after “value” in my insert query. My insert query is like-  
“Insert into tablename (column1, column2,…column13) values (the variables shown in the pic above);”  
I am writing the query in the non-execute query activity of UiPath. The showing is invalid “column” name whereas all those are the variables. I have also used the connect activity before the non-execute activity.

---

<div class="post-metadata">

**Author:** ![vishal.kp](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/vishal.kp/32/92454_2.png) [@vishal.kp](https://forum.uipath.com/u/vishal.kp)\
**Post date:** [August 30, 2019, 4:32am UTC](https://forum.uipath.com/t/cant-insert-data-into-database-table/146491/2 "2019-08-30T04:32:07Z")

</div>

@diptojyotidutta Are you using the same column name in the table in the database. The column name of the datatable and the database should match.

---

<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:** [August 30, 2019, 4:38am UTC](https://forum.uipath.com/t/cant-insert-data-into-database-table/146491/3 "2019-08-30T04:38:46Z")

</div>

@vishal.kp no i am not using the same column name as that of the datatable.  
Actually the problem is that the Website from where i am scraping the data has special characters in it. Plus i wanted to split some rows as some rows had multiple data.  
For example- row(0) has Both Billno. and Date in it and i don’ want it to stay in that way.  
As a result of that in my database table i created to separate column, one is Billno, and the second is Date. There are two such rows which i split into two. And i am taking the data from the datatable(data scraping from website) to my database.

---

<div class="post-metadata">

**Author:** ![vishal.kp](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/vishal.kp/32/92454_2.png) [@vishal.kp](https://forum.uipath.com/u/vishal.kp)\
**Post date:** [August 30, 2019, 4:40am UTC](https://forum.uipath.com/t/cant-insert-data-into-database-table/146491/4 "2019-08-30T04:40:35Z")

</div>

first of all for your data to get transferred to database.Your column names should match.Match it and try. edit in sql the same column name as of data scraped.

---

<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:** [August 30, 2019, 4:43am UTC](https://forum.uipath.com/t/cant-insert-data-into-database-table/146491/5 "2019-08-30T04:43:05Z")

</div>

I have tried it before but it didn’t worked at that time as well. I even tried to do away with the spaces in my column name but that too failed.

---

<div class="post-metadata">

**Author:** ![vishal.kp](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/vishal.kp/32/92454_2.png) [@vishal.kp](https://forum.uipath.com/u/vishal.kp)\
**Post date:** [August 30, 2019, 4:46am UTC](https://forum.uipath.com/t/cant-insert-data-into-database-table/146491/6 "2019-08-30T04:46:19Z")

</div>

can u share the workflow

---

<div class="post-metadata">

**Author:** ![Snehal14Kapse](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/snehal14kapse/32/182678_2.png) [@Snehal14Kapse](https://forum.uipath.com/u/Snehal14Kapse)\
**Post date:** [February 4, 2021, 10:07pm UTC](https://forum.uipath.com/t/cant-insert-data-into-database-table/146491/7 "2021-02-04T22:07:12Z")

</div>

Hello @diptojyotidutta Read Workbook Activity instead of using Excel Read Range Activity. Extra columns/rows will be added if you don’t provide exact range in Excel Read Activity.

Store Result in Data-table & use Insert Activity to store data inside Database.
