Bulk insert and Insert DB in Uipath

Hi,

I see 2 activities “Insert” and “Bulk Insert” in database activities panel. Can someone please help me with its differnece

image

Hi @garimavarshney9 ,

Maybe you could check the below documentations :

Insert :
https://docs.uipath.com/activities/other/latest/user-guide/insert-data-table

Bulk Insert :
https://docs.uipath.com/activities/other/latest/user-guide/bulk-insert

In UiPath, you can perform bulk insert and single insert operations to a database using the Database activities package. You can use the Insert activity for single inserts and the Execute Non-Query activity for bulk inserts.

Here’s how to perform a bulk insert and a single insert operation in UiPath:

  1. Install Database Activities Package:a. Open your UiPath Studio.
    b. Go to the “Manage Packages” button on the top right corner.
    c. Search for “UiPath.Database.Activities” and click Install, then Save.
  2. Connect to the Database:
    a. In UiPath Studio, on the Activities panel, search for “Connect” in the Database section.
    b. Drag and drop the “Connect” activity into your sequence.
    c. Fill in the Connection details such as ConnectionString, ProviderName, etc., for your database. This will establish a connection to the database.
  3. Perform a Single Insert:
    a. Search for “Insert” activity in the Database section.
    b. Drag and drop the “Insert” activity into your sequence after the “Connect” activity.
    c. In the “Insert” activity, set the “DataTable” property to the DataTable you want to insert the data from.
    d. Set the “TableName” property to the destination table in the database.
  4. Perform a Bulk Insert:
    a. Search for “Execute Non-Query” activity in the Database section.
    b. Drag and drop the “Execute Non-Query” activity into your sequence after the “Connect” activity.
    c. In the “Execute Non-Query” activity, enter the SQL bulk insert statement as the “Sql” property. For example:
INSERT INTO TableName (Column1, Column2, Column3) VALUES (@Value1, @Value2, @Value3)

d. In the “Parameters” property, use a collection of “SqlParameter” objects to replace the placeholders (@Value1, @Value2, @Value3) with the actual values.
5. Close the Database Connection:
a. Search for “Disconnect” activity in the Database section.
b. Drag and drop the “Disconnect” activity into your sequence after the “Insert” or “Execute Non-Query” activity.

Now, when you run this sequence, it will connect to the database, perform the single insert or bulk insert operation, and then close the connection.

Check here also: