0

I have a query where I generate a XMLSCHEMA and a XML sample.

SELECT TOP (10) 
    filename, queue, owner, resubmitFile, 
    pages, system, created, server, preflightlogs, status, kit, totalkits
FROM 
    Preflight_analytics
FOR XML AUTO, XMLSCHEMA ('Preflight_analytics')

All my columns have a description associated with it.

Is it possible to get the column description place inside the xsd like the below sample? I use the xsd to generate documentation and the tool I use, uses the tag <xsd:documentation> to add the description to the docs - like below:

<xsd:attribute name="JobID" fixed="" use="required">
    <xsd:annotation>
      <xsd:documentation xml:lang="en">Vendors unique ID</xsd:documentation>
    </xsd:annotation>
    <xsd:simpleType>
      <xsd:restriction base="sqltypes:varchar" sqltypes:localeId="1033"
        sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth"
        sqltypes:sqlSortId="52">
        <xsd:maxLength value="50"/>
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute

I been looking over the docs here haven't found anything yet but still looking.

Thank you Mike

Mike
  • 1,221
  • 3
  • 15
  • 34
  • Must you use XMLSCHEMA or could you query information schema like in [this post](https://stackoverflow.com/questions/17520448/how-to-create-xml-schema-from-an-existing-database-in-sql-server-2008) ? – Ezin82 Dec 15 '17 at 20:04
  • This is how the XML SCHEMA was created. – Mike Dec 19 '17 at 13:04

0 Answers0