RE: Where are documents saved in GP?
Hi Richard,
When you use the Document Attachment feature in Dynamics GP the attached document is stored as a SQL blob in the coAttachmentItems table of the company db.
I am not aware of a supported method to store the file in an alternate db as it is a static code location and not something you can choose as a default option.
Also, please note that the Document Attachment File Utility (Administration | Utilities | Company | Delete Attachment Files) will only clear out attachments that have already been manually delated in the program (and existing on the 'deleted' tab).
As such, if the attachments are causing performance issues you can back-up the existing db for historical purposes and remove the interconnected Document Attachment table data at your discretion.
As for how the data is stored, the following SQL statement will pull up the attachment data:
select * from coAttachmentItems where fileName = 'XXXXXX.docx' -- replace with your exact document/extension
And the following SQL statements should list the rest of the associated table materials for possible clearing:
select fileName,* from CO00101 where Attachment_ID = (
select Attachment_ID from coAttachmentItems where fileName = 'XXXXXX.docx')
select BusObjKey,* from CO00102 where Attachment_ID =
(select Attachment_ID from coAttachmentItems where fileName = 'XXXXXX.docx')
select BusObjKey,* from CO00103 where Attachment_ID =
(select Attachment_ID from coAttachmentItems where fileName = 'XXXXXX.docx')
-- usually empty unless changes made on the document
select BusObjKey,* from CO00104 where Attachment_ID =
(select Attachment_ID from coAttachmentItems where fileName = 'XXXXXX.docx')
select BusObjKey,* from CO00105 where Attachment_ID =
(select Attachment_ID from coAttachmentItems where fileName = 'XXXXXX.docx')
Best Regards,
Jeff
Dynamics GP Support