Writing entire data table to db via db sql executor node

I want to import a data table into my sql table, but the IDs need to come from an sql sequence (for reasons I have no control over).

I was therefore looping through my data table using chunk loop start, and then for every row I was transforming table rows to variable and then executing the below sql statement in my db sql executor node, using the flow variables.

However, this is taking way too long so I wanted to use a more efficient approach. One option was to do a db insert obviously, but for that I would first need my IDs. Unfortunately though, due to sub-query restrictions, it is not possible to query for sequence IDs in nodes such as db reader, db query reader or db looping.

Does anyone have a workaround for this?

DECLARE @NextWellID INT; SELECT @NextWellID = NEXT VALUE FOR dbo.WELL_ID; INSERT INTO dbo.WELL (WELLID, PLATEID, ROWS, ROWN, COLS, COLN, SAMPLEID, WELLROLE, VOLUME) VALUES (@NextWellID, $${IPLATEID}$$, ‘$${SROWS}$$’,$${IROWN}$$, ‘$${SCOLS}$$’, $${ICOLN}$$, $${ISAMPLEID}$$, ‘$${SWELL_ROLE}$$’, ‘$${SVOLUME}$$’)