QueryFile

The QueryFile is an XML file which contains the queries, typically SQL statements.
An example of a QueryFile (can be named whatever):
<?xml version="1.0" encoding="utf-8" ?>
<Queries>
  <Query Database="SQLServerTest" Name="GetSqlStuff">
    <QueryText><![CDATA[SELECT * FROM tbTable;]]></QueryText>
  </Query>
  <Query Database="SQLServerTest" Name="InsertSqlStuff" IsStoredProcedure="true">
    <QueryText><![CDATA[InsertSP]]></QueryText>
  </Query>
</Queries>

QueryFile XML Schema

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="Queries">
    <xs:complexType>
      <xs:sequence>
        <xs:element maxOccurs="unbounded" name="Query">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="QueryText" type="xs:string" />
            </xs:sequence>
            <xs:attribute name="Database" type="xs:string" use="required" />
            <xs:attribute name="Name" type="xs:string" use="required" />
            <xs:attribute name="IsStoredProcedure" type="xs:boolean" use="optional" />
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

Last edited Jul 18, 2008 at 6:34 AM by dotnetCarpenter, version 4

Comments

No comments yet.