How To insert Excel file data into MS SQL table

Hi Team,

So many Ui Path users are asking the same question , But we didnt find any clear and easy way of solution for this, Please can any one guide us clearly how to import excel data into SQL, (My Excel file contains data fileds with text,date,decimal data types) . Please it would be great help if any one explain this by uploading xaml file. Please help us , really so many users want to know this.please find the sample excel file below. We know hot to insert data into sql for single row.

samplefile.xlsx (9.5 KB)

2 Likes

hi @rakeshadn, how will you insert data into sql? by using INSERT query? Are you trying to insert all the rows from your excel to SQL?

Yes, we want to upload data into sql server, please help by sending xaml file

@rakeshadn Follow below link

How to Dump scarped data into database which is scraped using data scrapping

Hi @rakeshadn, let’s see whether the link @indra shared will fulfil your requirement.

Cheers.

Hi quihan, Indras link doesnot contain the information what i have asked for, Please i request without taking any diversion , Please just upload the excel file content which i have shared into SQL by using RPA. This is what we are expecting in xaml file. Please help on this it will be highly appreciatable.

@rakeshadn Do you download the link which I have shared it will take data from csv and put into database this is the requirement you was having…

Yes, i Have downloaded, I need from excel, For Excel in the same way we tried data will not import, In excel file if we have differnt types of data types then errors will come, So we want to upload it using insert into by using parameters.

@rakeshadn,

Extracting data from excel should be straightforward using the read range activity. It may be beneficial for you to provide a sample of your excel file so the forum can better understand the challenges you are having.

samplefile.xlsx (9.5 KB)

Hi i have already uploaded sample excel file , Any how again i have uploaded sample excel file please check. Thanks

Thanks for providing again, not sure how I missed that. Looking at your sample you should be able to utilize @Indra 's csv to database example. You will just need to change the first activity from read csv to read range in order to interact with the Excel file.

Hi Team,

Above link example is csv to My SQL, where as i requested for Excel to MS MSQL, Even though i use Read range, Data is not pumping into SQL server. So many times i am requesting for this, really disappointed on this , upto now no one provides perfect solution, its just simply deviating the requirement.

My SQL table contains 1 column with date type and one column with Decimal type , how to import that data into ms sql.

@rakeshadn

Find the attached xaml file FYR

Replace your connection string and file path.

PFB SQL Table creation Query

Create Table ExcelToTbl
(
From_Currency NVarchar(100),
To_Currency NVarchar(100),
Conversion_Rate Decimal(10,5),
Conversion_Date Date
)

ExcelToTable.xaml (8.8 KB)

Regards
Madhura

3 Likes

Hi Madhuraj, Thank You So Much for your Awesome Solution, Really it helps a lot for us.

Once again thanks for your effort for providing xaml file with clear explination.

1 Like