title: Simple Sql Procedure with/without cursor
body: <p>Please help me with a simple procedure, lets say on Sql Server (2005, 2008, does not matter).</p>
  
  <p>I have table <code>dbo.[columns] with 1000 lines</code>, which all are the names for some specific table names from a database.</p>
  
  <p>Bottom line is that I need to create a procedure which will parse all 1000 lines of tables,
  for each table name found in dbo.[columns] to execute the following </p>
  
  <pre><code>select: select count(*), ''''+[column_name]+'''' from dbo.[column_name]
  </code></pre>
  
  <p>The result should be like this:</p>
  
  <pre><code>count(*)    table_name:
  100          employees 
  0            ex_employees
  25           addresses
  10           birthdays
  </code></pre>
  
  <p>Any hints?</p>
  
  <p>Thanks in advance,
  Bogdan</p>