Hi Miguel, first of all thank you for sharing your feedback.
This approach didn't fix the issue, the result of the execution was zero rown, however I can still see emails with attachments in the system and I'm not able to delete them.
Do you know what are all the tables where is maintained the field ActivityMimeAttachmentId? I ask you this because looks like the GUID maintained is wrong/missing in one of the tables at least.
How I know this, well because executing this script I'm able to get the ActivityMimeAttachment record
SELECT *
FROM [dbo].[ActivityMimeAttachment]
WHERE [ObjectId] = '422077B9-D651-E811-80EB-005056934E24'
and executing this script I'm able to get the linked attachment
SELECT *
FROM [dbo].[Attachment]
WHERE [AttachmentId] = '4A2077B9-D651-E811-80EB-005056934E24'
