How can I see the size of the attachments that are stored in my database?

Version 1

    Details

    Is there a way to view and sort Attachments by size? I'd like to purge the largest and oldest attachments from my database.


    Resolution

    Database-stored attachment size information can be obtained along with other relevant data about attachment storage with this SQL query:

    select datalength(FusionA.FileBytes) as Filesize, Attachment.* from FusionAttachments FusionA full outer join Attachment Attachment on Attachment.Recid = FusionA.Recid order by datalength(FusionA.FileBytes) desc