T-SQL : getting the column descriptions into a XMLSCHEMA

68 views Asked by At

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

0

There are 0 answers