title: Get the Row count of the result of a Stored procedure in coldfusion
body: <p>I'm new to coldfusion. I'm executing "SP_REPORT" stored procedure and handling the result set in "result".
  If result contains rows I'm displaying the data in table. I would like to handle the case when Stored procedure returns zero rows. If there are zero rows, I would like to display other table. How can I get the count of result. Thanks in advance</p>
  
  <pre><code>&lt;cfstoredproc procedure="SP_REPORT" datasource="#DataBse#" &gt;        
     &lt;cfprocparam type = "In"     CFSQLType = "CF_SQL_INTEGER"  value ='#Id#'   dbVarName = "@Id"&gt;
     &lt;cfprocresult name="result"&gt;
  &lt;/cfstoredproc&gt;         
  &lt;table&gt;
  &lt;cfloop query="result"&gt;
      &lt;tr class="row#result.CurrentRow MOD 2#"&gt;
      &lt;td align="left"&gt;#result.COMPANY_NAME#&lt;/td&gt;
      &lt;td align="left"&gt;#trim(result.FName)#&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/cfloop&gt;
  &lt;/table&gt;
  </code></pre>