• Jeff Moden - Wednesday, August 8, 2018 12:12 AM

    Eirikur Eiriksson - Tuesday, August 7, 2018 11:49 PM

    Thank you for this article Diogo, nice write-up.
    😎

    Quick thoughts, I think it would benefit from slightly more technical details on the SQL Server's implementation of XML, such as the schema collections and the difference between typed and untyped XML. On the storage side, the method used to store XML in SQL server is a binary representation of the XML, not an identical copy. This safes roughly around 20% compared to storing the XML in text files.

    Uh huh... what about during data transmission?  And, I could certainly be incorrect, but considering that the XML text files are 8 to 16 times larger than delimited text to begin with, I'm thinking that's not much of a savings.

    Of course it does depend on the structure of the XML, if it's element or attribute bound etc., but because of the binary storage, there is little difference between short and long element and attribute names.
    😎

    When it comes to the storage size comparison, lets include the final target, the SQL Server database😉
    Here is a recent example (SQL Server 2017 RTM):

    XML files on disk 42.7 MB
    XML content in XML column 36.8 MB
    The content parsed into a normalized and optimized schema 41.3 MB