Append DataTable from SQL Query

excel
activities
studio
sql

#1

Hi All,

I’m trying to append data table to excel which was extracted from a SQL table. But unfortunately I don’t get to paste the header of the SQL table in the excel.

How do I append the data table together with the header?


#2

Hi @Serran_Neru,

It has many way to do this.
To append the datatable to Excel
1.Read the Excel into datatable called dtExcel.
2.Do the merge the datatables dtExcel and dtSource by using Merge Data table activity
3.Overwrite it by using the WriteRange activity

or you can write into the excel directly by using the writecell activity to do some for loops.

Regards
Balamurugan.S


#3

Hi @balupad14,

So you’re saying that I need to merge the table from SQL and the header table from and excel?

But if I do so, I’m getting below error.
Merge data table : .ItemNo and .ItemNo have conflicting properties: DataType property mismatch.

Regards,
Serran


#4

Hi @Serran_Neru,
Can you share the source ?

Regards
Balamurugan.S


#5

I’ve attached the workflow.

My issue is when I append/write range “offUpload” data table into an excel. It does not paste with the header.

TestSmall(Autosaved).xaml (10.4 KB)


#6

Hi @Serran_Neru,

Yes. you are right. it will bring the data type infliction between and excel and the datatable(which comes from the sql.)

I have done some changes in xml. I think it will fix it.

File : TestSmall(Autosaved).xaml (11.4 KB)

You have to specify the columns which it marked read.

Regards
Balamurugan.S