Skip to content

[BUG] The presence or absence of results depends on the columns selected in SELECT #644

Description

@hiroyuki0415

The presence or absence of results depends on the columns selected in SELECT

SELECT 1 -- empty
SELECT sub.changedata -- empty
SELECT * -- not empty
FROM (
	SELECT a.objectidtype,
		a.changedata
	FROM audit AS a
	WHERE a.objectidtype = 'some_entity'
		AND a.objectid IN ('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx')
		AND ISJSON(a.changedata) = 1
	) AS sub
OUTER APPLY OPENJSON(sub.changedata, '$.changedAttributes') AS tmp
OUTER APPLY (
	SELECT JSON_VALUE(tmp.value, '$.logicalName') AS logicalName
	) AS tmp1
WHERE tmp1.logicalName IN ('some_column')

Environment

  • SQL 4 CDS edition: XrmToolBox
  • Results of SELECT @@VERSION:
Microsoft Dataverse - 9.2.25021.188
   SQL 4 CDS - 9.6.0.0
   2 23 2025 06:26:13
   Copyright © 2020 - 2024 Mark Carrington

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