Skip to content

[BUG] Column 'nickname' does not allow DBNull.Value. Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. #677

Description

@fowl2

Describe the bug
The nullability inference seems not to understand De Morgans's laws.

To Reproduce
Assuming there is at least one row in systemuser with a value for fullname and a nickname that is NULL.

select nickname from systemuser
where NOT (fullname is null and nickname is null) 

Produces error:

Column 'nickname' does not allow DBNull.Value.
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Expected behavior

The equivalent:

select nickname from systemuser
where fullname is not null OR nickname is not null

Works fine.

Environment (please complete the following information):

  • SQL 4 CDS edition: XrmToolBox
  • Results of SELECT @@VERSION:
    Microsoft Dataverse - 9.2.25051.174
    SQL 4 CDS - 9.6.1.0
    May 02 2025 16:58:10
    Copyright © 2020 - 2025 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