Store Documents In SQL Server XML vs Varchar(max) vs Filesystem

  • Hi Everyone,

    Have an idea wanted some constructive feedback on for a design.

    I have some documents that are structured ie Summary, section1, Paragraph 1, Body, Summary,.... These documents contain pieces that are updated by different people then combined into a final draft that is published out to the filesystem for multiple readers to view. Only those people who are responsible for that section should have the ability to add/delete/alter that section for example the "Summary". To save in the database we have the idea to break out each piece and save as a seperate record meaning each document would have a relationship to many sections, but are structured the same. We would use the XML datatype functionality in SQL2005. This allows each user the ability to only update one section, and saves I/O from having to save the full document. Then our readers have a "de-normalized" so to speak full document (Final Draft) out on the file system.

    Anyone done anything similiar? How was your experience?

  • It certainly does work. Your security is going to make it a little tricky, in that one reason to maintain it in a SINGLE XML fragment is to leverage XML's implicit order to maintain the document order. By breaking out each section, you are now going to need to also break out the "internal ordering" of the sections of a document (so that the header still appears first, followed by paragraph #1, paragraph #2, etc....).

    So - it's going to be a conceptual pain vs gain analysis which method works out better (put the "section security" in the DB or the UI?) We opted to keep them in one single record, since it then allowed us to hold on to hashcodes/digital signature so to speak of the documents (so as to ensure that noone "monkeyed" with the final document on the OS drive.)

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply