title: Finding number of columns returned by a query
body: <p>How can I get the number of columns returned by an SQL query using SQL Server? </p>
  
  <p>For example, if I have a query like following:</p>
  
  <pre><code>SELECT  *
  FROM    A1, A2
  </code></pre>
  
  <p>It should return the total number of columns in table A1 + total number of columns in table A2. But the query might be more complicated.</p>