Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 using OPENXML to import a XML file with Inline XSD Schema

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-08-15 : 12:09:49
Alex writes "My problem is to import a XML file using OPENXML or any other command into SQL table. I'm not sure how to import a XML file Inline XSD Schema.

I need to import all catalog (database) names from my Analysis Services 2005.

When I execute following XMLA query:

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>DBSCHEMA_CATALOGS</RequestType>
<Restrictions>
<RestrictionList/>
</Restrictions>
<Properties>
<PropertyList>
<DataSourceInfo>AnyValueWorks</DataSourceInfo>
</PropertyList>
</Properties>
</Discover>
</Body>
</Envelope>



I get result as XML file which is:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<DiscoverResponse xmlns="urn:schemas-microsoft-com:xml-analysis">
<return>
<root xmlns="urn:schemas-microsoft-com:xml-analysis:rowset" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:schema targetNamespace="urn:schemas-microsoft-com:xml-analysis:rowset" xmlns:sql="urn:schemas-microsoft-com:xml-sql" elementFormDefault="qualified">
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element name="row" type="row" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:simpleType name="uuid">
<xsd:restriction base="xsd:string">
<xsd:pattern value="[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}" />
</xsd:restriction>
</xsd:simpleType>
<xsd:complexType name="xmlDocument">
<xsd:sequence>
<xsd:any />
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="row">
<xsd:sequence>
<xsd:element sql:field="CATALOG_NAME" name="CATALOG_NAME" type="xsd:string" minOccurs="0" />
<xsd:element sql:field="DESCRIPTION" name="DESCRIPTION" type="xsd:string" minOccurs="0" />
<xsd:element sql:field="ROLES" name="ROLES" type="xsd:string" minOccurs="0" />
<xsd:element sql:field="DATE_MODIFIED" name="DATE_MODIFIED" type="xsd:dateTime" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<row>
<CATALOG_NAME>Adventure Works DW</CATALOG_NAME>
<DESCRIPTION>A Unified Dimensional Model that encompasses the Adventure Works data warehouse.</DESCRIPTION>
<DATE_MODIFIED>2006-07-21T08:49:48</DATE_MODIFIED>
</row>
<row>
<CATALOG_NAME>Databse Test 1</CATALOG_NAME>
<DESCRIPTION>Databse Test 1</DESCRIPTION>
<ROLES>*,all</ROLES>
<DATE_MODIFIED>2006-07-26T09:40:16</DATE_MODIFIED>
</row>
<row>
<CATALOG_NAME>Databse Test 2</CATALOG_NAME>
<DESCRIPTION />
<DATE_MODIFIED>2006-07-13T10:21:31</DATE_MODIFIED>
</row>
<row>
<CATALOG_NAME>Databse Test 3</CATALOG_NAME>
<DESCRIPTION>Databse Test 4</DESCRIPTION>
<DATE_MODIFIED>2006-07-13T10:21:31</DATE_MODIFIED>
</row>
<row>
<CATALOG_NAME>Managing Dep
   

- Advertisement -