Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Error "Value cannot be null" when using variables #605

Closed
hiroyuki0415 opened this issue Dec 5, 2024 · 1 comment · Fixed by #613
Closed

[BUG] Error "Value cannot be null" when using variables #605

hiroyuki0415 opened this issue Dec 5, 2024 · 1 comment · Fixed by #613

Comments

@hiroyuki0415
Copy link

hiroyuki0415 commented Dec 5, 2024

DECLARE @businessunitid AS UNIQUEIDENTIFIER = '72a2eae0-6da2-474e-b97b-158d0042d4b4';

SELECT b.businessunitid
FROM   businessunit AS b
WHERE  b.businessunitid IN (@businessunitid);

When I run this SQL, I get the below error:

Value cannot be null.
Parameter name:key

Environment

  • SQL 4 CDS edition: XrmToolBox
  • Results of SELECT @@VERSION:
Microsoft Dataverse - 9.2.24111.198
	SQL 4 CDS - 9.4.1.0
	11 11 2024 12:05:16
@MarkMpn
Copy link
Owner

MarkMpn commented Dec 10, 2024

This will be fixed in the next update, but seems to only affect an IN query with a single value - if you rewrite this as an = condition instead, or add more values to make it worthwhile using IN it should work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants