Vrishchik
(Naveenkumar Shivaraju)
March 21, 2023, 7:42am
1
Hi All,
I need to upload the data from excels to the database(MSSql) under below conditions:
Bot will download 3 to 4 excels(Number of excels are not constant it can be vary) at a time and all the column names/headers are same for all excel.
I need to upload the downloaded excels to the MSSql DB.
Please let me know how can I do this??
@vishal.kp
@ppr
@supermanPunch
@Gokul001
@Chirag_Shetty_Divakar
@Yoichi
@ushu
ushu
(Usha kiranmai)
March 21, 2023, 8:36am
2
Hi @Vrishchik Please follow below steps
Connect data base using data base related packages UiPath.DataBase.Activities
Once the bot downloads the files, use Directory.GetFiles
to read the list of files from that folder
Loop each file, use Read Range
activity and store the data in data table
Loop each row and insert the data to SQL. Check below link for more info
Video Links - Connecting to SQL Server DataBase Using UiPath | UiPathLearner | SQL Server in UiPath | UiPath SQL - YouTube
Vrishchik
(Naveenkumar Shivaraju)
March 21, 2023, 9:04am
3
“message”: “Bulk insert: The provided columns in the DataTable do not match the column data types in the database.”,