title: Create indexes for all tables in database?
body: <p>I know I can index a column in a table with the command:</p>
  
  <pre><code>CREATE UNIQUE INDEX index_name
  ON table_name (column_name)
  </code></pre>
  
  <p>However, I have a database of 250 schemas with 10 tables each. How can I, <strong>for each table</strong>, check if a column exists, and then create an index for it (if it does exist)?</p>
  
  <p><em>I am using SQL Server 2012.</em></p>