Skip to content

[BUG] Cannot Insert Rows that select a GUID from another table #643

Description

@tsileo-wdi

Describe the bug
Attempting to insert rows into a table using GUIDs that are selected from another table generates this error:

Msg 0, Level 20, State 1, Line 9
Object reference not set to an instance of an object.

To Reproduce

insert into owk_taskoutcome (owk_taskoutcomeid, owk_name)
select owk_datacaptureoutcomeid,owk_name
from owk_datacaptureoutcome;

Expected behavior
select owk_datacaptureoutcomeid,owk_name
from owk_datacaptureoutcome;

Returns:
owk_datacaptureoutcomeid owk_name
218ae23d-48ee-ef11-be20-7c1e5258ff38 Successful
be1ebd7a-ceee-ef11-be20-7c1e5258ff38 Missing Address

This insert works fine:
insert into owk_taskoutcome (owk_taskoutcomeid, owk_name)
values ('218ae23d-48ee-ef11-be20-7c1e5258ff38','Successful');

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • SQL 4 CDS edition: XrmToolbox
  • Results of SELECT @@VERSION:
    Microsoft Dataverse - 9.2.25022.152
    SQL 4 CDS - 9.5.1.0
    Dec 15 2024 16:55:19
    Copyright © 2020 - 2024 Mark Carrington

Additional context
I think this is a valid thing to do in Dataverse - especially since I can do it with the values() clause using the same values that are in the source table I'm trying to copy rows from. I want to retain the existing GUIDs on the new table.

Sponsorship
If you find this tool useful, please consider sponsoring its development.

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