So i was trying to create bulk SQL insert query using Excel itself
So here are the two parts of it
First the formula to create the insert command
=" Insert into tableName("&A1&","&B1&",and so on for the rest of the columns) values"
So here the tableName will be a string variable which holds any kind of table name string
The “&CoulmnId&” in here the double quotes and the & operator is used for contacting the columns
Second formula to create the data command
="('"&A2&"','"&B2&"','"&TEXT(C2,"MM/DD/YYYY")&"','"&D2&'"),"
Now in here i have to add a single quate and a double quato
The single quate will be added to the final result will say that the value is a string in SQL
Now as you can see i have added ‘“&TEXT(C2,“MM/DD/YYYY”)&”’ which means that the column contains a date because when i just use the normal concat like above the coumnn which contains the date is getting a wierd output so for that reason I’m adding this specific date format so i can get the date as it is in the column
Now in the real question is how do I automate it in uipath
I just have to automate two rows the first one that contains the coumnnname will be the insert query formula
Now the second one will be the first data formula eventually i will just drag ( or double click the cell that contains the data formula so it will apply to all the below rows that contains the data
Okay wait a min stop reading further , if you are getting confused just look at this entire video and you will understand it all
Now i will tell you what things are dynamic here
Insert one
1:- after a read range i will get it into the datatable now i want that the automation identify the column I’d and put the column I’d inside that fix “&coumnid&”
2:- actually i don’t want the table name to be dynamic i will later change the table name manually as it’s is not a big concern
3:- idk how the double quotes will work here
4:- after each ending double quote it should add a comma to sperate the next one from the last one added ( actually didn’t need comma after the last coulmn end but i can remove it manually if its cplicated
Data one
1:- as the same datatable will get the second row ( contains the first data) it has to identify the column I’d and then add it in a single quate then in a double quote and finally insiee the & coumn I’d and repeat it for closing that particular concat
2:- most of the steps are same for the data as shown in the insert
3:- now when the automation is getting or get the data it has to identify the date column (i will provide a manual date format so Automation didn’t have to identify the date format but it has to identify that the cell it is in rn contain a date ) and then the automation has to add the TEXT (coumnid,“my given date format”) and then continue the normal Automation for the rest of the data
4:- the data will always have a string values in it so Automation have to add single quate for each of them
Note! I forgot to mention that not all of the Coulmn contains data so the Automation also have to look for empty coulmn and then adjust the insert formula and the data formula accordingly by not selecting the empty coulmn
Also i want the Automation to be a string Automation and not ui automation so if you are thinking to use Excel itself to automate it no