Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Suggested answer

Is there a way to shrink the images in coAttachmentItems

Posted on by 75,730

One of our clients ran out of space on their drive this morning. Their company database is 95GB in size with 71GB in the coAttachmentItems table. Is there any way to shrink the blobs in that table to reduce the overall size of the database?

Categories:
  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    RE: Is there a way to shrink the images in coAttachmentItems

    Richard,

    I haven't used Steve's tool to extract attachments and don't know if you could specify a different location, but the files being extracted in TIFF format makes sense, as this is either the original scanned document format, or it is the format Microsoft uses to upload every attachment (which would surprise me). TIFF is not known as being particularly space savvy, but it allows for multi-page images like PDF's.

    I'd try to convert all of those from TIFF into PDF, as you can apply compression to PDF which you cannot on TIFF.

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Is there a way to shrink the images in coAttachmentItems

    I now have a physical problem. Initially the problem was I was running out of space. Using Steve Endow's application completely goobled up space as it was saving the images to separate files. I added 100GB and that was not enough. I will add another 100GB and see how it goes. The goal will be to import these images into another application and into another database.

  • Tim Wappat Profile Picture
    Tim Wappat 5,701 on at
    RE: Is there a way to shrink the images in coAttachmentItems

    Have a look at this:

    SELECT TOP(100) * FROM CO00102

    You should be able to work it out from there.

    Gives you the table&key and AttachmentID.

    Its ugly to decode but makes sense when you look at it.

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Is there a way to shrink the images in coAttachmentItems

    This applications works. It extracts the images out as tiff files. Now there is a column called AttachedmentID. Can that be used to tie it back to a GP document? If so, how?

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Is there a way to shrink the images in coAttachmentItems

    Thanks Beat. Steve is the man!!!!

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    RE: Is there a way to shrink the images in coAttachmentItems

    Richard,

    Have you looked at Steve's solution?

    https://blog.steveendow.com/2018/12/bulk-export-dynamics-gp-document.html?m=1

    That should help.

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Is there a way to shrink the images in coAttachmentItems

    Is there a way to extract those images out of the coAttachment tables? If so, I will look into moving them into Docuware which I have successfully used with GP. That way I could move them into a completely separate database.

  • Suggested answer
    Beat Bucher  GP Geek  GPUG All Star Profile Picture
    Beat Bucher GP Gee... 28,021 Super User 2024 Season 1 on at
    RE: Is there a way to shrink the images in coAttachmentItems

    Hi Richard,

    depending on your SQL version, you may want to look into Data Compression for some tables..

    docs.microsoft.com/.../data-compression

    Of course I'd try this first on a TEST environment to see how this impacts GP on a daily basis.

    The other option would be to check why documents are that large in that table and how many attachments are in there.. Maybe there would be a way to reduce the size of the files prior of being attached in GP.. Like selecting a different picture format (i.e. PNG is more efficient than JPG).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans