title: Generate table DDL via query on MySQL and SQL Server
body: <p>Is there an easy way to extract table DDL information, via a query, using either Ms or My SQL server?  (preferably both?)</p>
  
  <p>For example, using MySQL Administrator / Navicat for MySql, there is a "DDL" function, which generates the "create table foo (....)" script.</p>
  
  <p>Is there any way to get this information from a query itself, such as:</p>
  
  <pre><code>Select DDL from foo where table_name='bar';
  </code></pre>
  
  <p>Any have the "Create table bar (.....)" returned to me?</p>
  
  <p>If not - any suggestions?</p>