How to upload the downloaded input excel data to MSSql database

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

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

“message”: “Bulk insert: The provided columns in the DataTable do not match the column data types in the database.”,

Hi @Vrishchik

Try this

Hope this might help you :slight_smile:

1 Like