How to insert a datatable into SQL Server database using Uipath database activities?

I have a datatable DT with 25 columns. I want to insert that data from DT into a SQL Server table SQDT with the same columns. I’m using an INSERT query for now.

Is there a better way to approach this problem instead of using INSERT on each record? Can I bulk insert into the database using a stored procedure or some other efficient way? It takes a lot of time to insert as DT has 130000 tuples.

There is a insert datatable activity, you must make sure all columns and datatypes are matched.

So the datatable in uipath and database must have the same number of columns etc.

A good way to ensure the dt is correct format is to do a select statement om the dt.

Select top 0 * from dt. This returns a blank datatable with the headers.

1 Like