Skip to content
OCTAVIIUS DOCSCore & Studio 0.2.83
Integrations / 0.2.83

Ingestion: BULK INSERT, JSON and CSV

Server-side loading, application batches, transport limits and write publication.

Ingestion boundaries and recovery

Server-side loading avoids application file transfer; HTTP ingestion allows applications to publish structured batches; the Studio wizard handles chunked upload and preview. These paths share type and permission checks while retaining their own publication units. Recovery must use durable effects and an application batch identity, distinct from the correlation query_id.

Server-side BULK INSERT

BULK INSERT requires admin and reads a file accessible to Core’s account. Create the table with columns in file order first. FORMAT CSV/CHAR and DATAFILETYPE char/widechar are available; SQL Server native binary and arbitrary format files are excluded. Recognized options are FORMAT, FIRSTROW, LASTROW, FIELDTERMINATOR, ROWTERMINATOR, FIELDQUOTE, CODEPAGE, DATAFILETYPE, BATCHSIZE, TABLOCK and KEEPNULLS.

FIRSTROW/LASTROW bound file rows. ROWTERMINATOR accepts LF, CR or CRLF. BATCHSIZE controls published batches; late errors do not undo previous batches. TABLOCK/KEEPNULLS do not imply the full related SQL Server machinery.

SQL
BULK INSERT dbo.Ventes
FROM 'D:\Imports\ventes.csv'
WITH (FORMAT='CSV', FIRSTROW=2, FIELDTERMINATOR=';',
      CODEPAGE='65001', BATCHSIZE=8192);

Application ingestion batches

Write-authorized API-key POST /api/v1/ingest accepts JSON batches of 1..10,000 rows or CSV up to 65,536 rows within a total 2 MiB request. Explicit columns map input; JSON rows are all objects or all arrays. CSV empty fields become NULL: use JSON or typed parameters to distinguish NULL and empty text.

Protocol 4 also exposes sys.sp_ingest under the current identity. Ingestion does not create a transaction spanning HTTP requests. Check counts, types and application deduplication before retrying a batch whose response was lost.

JSON
{"database":"Atelier","table":"dbo.Ventes","columns":["Id","ClientId","Pays","Montant","Jour"],
 "rows":[[5,1,"France","1.2500","2026-01-04"]]}

Post-load checks

Compare counts, exact totals, date ranges, Unicode and NULL handling against the source. INSERT permission does not add an unsupported uniqueness constraint. Idempotent recovery requires application-defined batch identity/control and effect checks; query_id does not provide it.