question

Katie 1 avatar image
Katie 1 asked

Create database table from XSD

ALL,

i want to know if there is a tool or a process to actually create the database or the database tables, if we have the XSD. to put it in other words, how do we utilize the XSD to create sql server database tables.

    <xsd:element name="ABC">
     <xsd:complexType>
  <xsd:attribute name="MTR_KEY" use="required">
    <xsd:simpleType>
      <xsd:restriction base="sqltypes:varchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
        <xsd:maxLength value="25" />
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="TRAN_DATE" type="sqltypes:datetime" use="required" />
  <xsd:attribute name="VERSION" use="required">
    <xsd:simpleType>
      <xsd:restriction base="sqltypes:numeric">
        <xsd:totalDigits value="2" />
        <xsd:fractionDigits value="0" />
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="FILE_ID" use="required">
    <xsd:simpleType>
      <xsd:restriction base="sqltypes:numeric">
        <xsd:totalDigits value="9" />
        <xsd:fractionDigits value="0" />
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="ROW_STATE" use="required">
    <xsd:simpleType>
      <xsd:restriction base="sqltypes:numeric">
        <xsd:totalDigits value="5" />
        <xsd:fractionDigits value="2" />
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="PROCESS_STATE" use="required">
    <xsd:simpleType>
      <xsd:restriction base="sqltypes:numeric">
        <xsd:totalDigits value="5" />
        <xsd:fractionDigits value="2" />
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
  <xsd:attribute name="LST_MODIFIED_DT" type="sqltypes:datetime" />
  <xsd:attribute name="LST_MODIFIED_USER">
    <xsd:simpleType>
      <xsd:restriction base="sqltypes:varchar" sqltypes:localeId="1033" sqltypes:sqlCompareOptions="IgnoreCase IgnoreKanaType IgnoreWidth" sqltypes:sqlSortId="52">
        <xsd:maxLength value="30" />
      </xsd:restriction>
    </xsd:simpleType>
  </xsd:attribute>
</xsd:complexType>

sql-server-2008sqlxmldba
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Oleg avatar image
Oleg answered

Here is the link to the post: http://social.msdn.microsoft.com/forums/en-US/sqlxml/thread/d8a68d63-832c-4393-8fd5-2f7445220172/ Basically, it involves opening BIDS and creating SSIS project with XML source.

Oleg

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.