Merging datatables in DataBases

Hi all,

I have used the UiPath Database package to read and write datatables from a database. Is it possible to merge all the data tables (append the rows from one to the other) across 2 databases using the “insert” activity, assuming both databases have the same schema?


this can be handled in two ways,
–we can use EXECUTE QUERY activity with any number of SQL Statements separated with semicolon between them which can include getting data from two different databases and then merge them with JOIN sql statement, and finally the activity gives us the datatable variable as output


–If we are facing issue in accessing two different databases at a time then we use two different EXECUTE QUERY activity and fetch the database data with two different sql select statements, thus gives us two different datatable variables
–now we can merge them with MERGE DATATABLE ACTIVITY as they have same schema structure with same column name, same order of column and same datatype of columns

hope this would help you
Kindly try this and let know for any queries or clarification
Cheers @deadhorse