title: Create SQL Server table programmatically
body: <p>I need to programmatically create a SQL Server 2008 table in C# such that the columns of the table should be generated from a list of columns (each column name is the name of a row in the table)</p>
  
  <p>My question is what is the command string to loop through the list of columns and creates the table's recorded: </p>
  
  <pre><code>List&lt;string&gt; columnsName = ["col1","col2","col3"]
  </code></pre>
  
  <p>I want to create a table with the columns in the <code>columnsName</code>. But since the list size in not constant, I need to loop through the list to generate the table columns.</p>