Skip to content

Improving Error Handling for Multi-Value RefID without Parent Object #30

@sorengranfeldt

Description

@sorengranfeldt

The current code lacks efficient error handling for cases where a multi-value refid doesn’t correspond to a parent object.

Code Snippet:

-- this code finds any missing parent objects
select refid, * from dbo.objectmv mv
left join dbo.object o on o.id = mv.refid
where o.id is null

Implement better error handling mechanism to address instances where the refid in multi-value doesn’t have a corresponding parent object. This could involve refining the SQL query to handle such scenarios more gracefully or adding constraints between tables to prevent such inconsistencies.

Code actions:

  • Review and possibly optimize the SQL query to ensure robust error handling.
  • Enhance error messages to provide more detailed information. Tip: Write better error messages to the event log and debug tracer for improved troubleshooting.

Documentation actions:

  • Consider establishing constraints between relevant tables to maintain data integrity and prevent such issues in the future. There should be a constraint from id in parent table to refid in mv table

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions