Can anyone please explain how to use the new Database activity "Bulk Update"?

Previously we used to write a query in “Execute Non query” activity to update the rows in SQL database tables, but now i am confused how to write a query or how to use this new “Bulk update” activity. can anyone please explain what properties we need to input and how to input them to update a few rows in a table in database.

Hi @jasonmomos158

As per the UiPath Docs for Bulk Update:

  • ColumnNames - The collection of column names used for row matching. This field supports only String[] variables.
  • DataTable - The DataTable object that will be used in updating the table. The DataTable columns descriptions must match the columns from the database table and be a subset of them. This field supports only DataTable variables.
  • TableName - The target database table. This field supports only String variables.

Just as in Bulk Insert, you would need to prepare the DataTable object to contain the data as you want in the database. Aside from the DataTable and database TableName, you also need to pass an array of String variables that represents your where clause.
For example: If you just want to update based on primary key say, ID column then you would specify
`ColumnNames = { “ID” }

One benefit I see here is that you could have multiple rows with different data updates without having to worry about worrying about bulk updating all rows. In other words, the separate batches will make sure that each record executes like its own update query, not a bulk update for all rows on just one blanket where clause.


Hello @jasonmomos158

Execute Non Query still works similar to how it used to work before and with the new Activities such as Bulk Update, we can update a compatible DataTable in an existing Table based on the Primary key column and it also returns number of rows affected.

I have attached an example for this activity with few screenshots-

Old Table :

Code :

After Update :
image (2.6 KB)



Thank you Ash Kulkarni

1 Like

Thankyou sumit.vijay for such an elaborate explanation with example, which i needed the most.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.