Home Forums SQL Server 2008 T-SQL (SS2K8) How do I use one column for node names and the others for elements in that node? RE: How do I use one column for node names and the others for elements in that node?

  • The point of XML is to transfer complex data between systems in a uniform way, its not really meant for passing simple data and is overkill for the case given.

    If we take the example of say an individual from the DVLA(DMV in the US) to a police central database, you have a variety of information that cannot be easily encapsulated in a single CSV row, so you would need several CSV files, one or more of which may get corrupted/lost in transmission.

    However in XML you can encapuslate all that information in a single file, without having to worry about the duplicating data, or losing a single critical file.

    The XML may be structured something like this

    <Driver name="" LicenceNumber="">

    <Licence detail>

    <Convictions>

    </Type>

    </points>

    </Issuedate>

    </expireDate>

    </ban duration>

    </Fine>

    </Conviction>

    </Illnesses>

    </Restrictions>

    </Licence detail>

    </Driver>

    <Driver>

    ::::::::

    </Driver>

    <Driver>

    ::::::::

    </Driver>

    As you can appreciate this is simpler to decode at the receving end rather than multiple CSV's and I suspect that there wouldnt be that much more "bloat" overall, possibly the XML file will be smaller than the combined information in several CSV files.

    _________________________________________________________________________
    SSC Guide to Posting and Best Practices