Skip to content

Multi-row INSERT: columns that are NULL in the first row are not populated for subsequent rows #784

Description

@poponosuke

Version: SQL 4 CDS 10.4.3.0 (XrmToolBox plugin)

Description:

When inserting multiple rows in a single INSERT statement, if a column value is NULL in the first row, that same column appears to be ignored for all subsequent rows — even when those rows have a non-NULL value. The affected columns end up as NULL in Dataverse.

Steps to reproduce:

  1. Run a single multi-row INSERT where the first row has NULL in some columns (e.g. bizwind_yubin_bng, bizwind_denwa_bng) but later rows have actual values in those columns.

Example:

INSERT INTO my_table (col_id, col_name, col_zip, col_phone)
VALUES
('001', 'AAAA', NULL, NULL),        -- first row: zip/phone are NULL
('002', 'BBBB', '445-811', '000-000-0000');  -- second row: zip/phone have values

Expected result:

Row 002 should have col_zip = '445-811' and col_phone = '000-000-0000'.

Actual result:

Row 002 has col_zip = NULL and col_phone = NULL. The values are dropped.

Additional findings from my testing:

  • Inserting row 002 by itself works correctly — the values are saved.
  • The problem only occurs in multi-row INSERT statements.
  • It happens specifically when the FIRST row has NULL in a column. If I reorder the rows so a row with values comes first, the values are saved correctly.
  • The columns affected are standard single-line text columns.
  • No error is shown; the insert succeeds but the values are silently dropped.
  • Hyphens in the values are not the cause (I tested values with and without hyphens).

It looks like the set of columns sent to Dataverse might be determined from the first row only. Could you confirm whether this is the expected behavior or a bug?

Thanks for the great tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions