Problem / Solution: Unable to delete a query in the console. Error: Delete statement conflicted with the reference constraint "fkey$md_query_condition$qa"

Version 2

    Verified Product Versions

    LANDESK Service Desk 7.6LANDESK Service Desk 7.7.xLANDESK Service Desk 7.8.xLANDESK Service Desk 2016.xLANDESK Asset Central 2016.xLANDESK Asset Central 2017.xLANDESK Service Desk 2017.x

    Error message:

    Delete statement conflicted with the reference constraint "fkey$md_query_condition$qa". The conflict occurred in database "[DATABASE NAME]", table "dbo.md_query_condition", column "md_query_attribute_guid". The statement has been terminated.

     

     

    Cause:

    If you create a query with at least one condition and then copy that query the child query will reference this condition preventing the original from being deleted.

     

     

    Solution / Workaround:

    In order to resolve this issue you will need to delete any query created as a child and any sub-children queries that were created. Once you have done that the reference constraint will be lifted and the original query can be deleted.