title: How to create XML/XSD from SQL table with multiple tables
body: <p>How to create XML/XSD from SQL table with multiple tables</p>
  
  <p>what I want to do is create an XML schema from a database (or database schema)</p>
  
  <p>This <a href="https://stackoverflow.com/questions/298660/getting-xml-schema-from-ms-sql-database">post</a> has some interesting code</p>
  
  <p>Particularly</p>
  
  <pre><code>DataSet results = new DataSet();
  
  SqlCommand command = new SqlCommand("SELECT * FROM table", new SqlConnection(connectionString));
  
  SqlDataAdapter sqlAdapter = new SqlDataAdapter(command);
  
  sqlAdapter.FillSchema(results, SchemaType.Mapped);//Fills dataset with schema from query
  results.WriteXmlSchema(mySchema);
  </code></pre>
  
  <p>But how do I generate this XML schema from multiple tables? If I just do </p>
  
  <pre><code>Select * from table1,table2
  </code></pre>
  
  <p>All of the data is in one big blob in the XML</p>
  
  <p>What I want is each table defined in the XML with it's contents separately. 
    something </p>