Bulk Insert: “The provided number of columns in the DataTable must match the number of columns in the DB table” — best practice with IDENTITY columns (SQL Server)

I’m trying to use the Bulk Insert activity in UiPath to load a DataTable into SQL Server.

My table has an OrderID column defined as INT IDENTITY(1,1). My DataTable only has the other 7 columns.

When I run Bulk Insert, I get this error:

The provided number of columns in the DataTable must match the number of columns in the DB table.

Is there a way to use Bulk Insert while letting SQL Server auto-generate the identity column? Or do I need to use a workaround like views or staging tables?

@Syed_Mustafa_Hasan,

Unfortunately no you can’t bulk insert if a auto generated column isn’t provided. You will have to use views or staging table for it.