title: Dynamic Create column in sql server with datatype
body: <p>I have table <code>TAB_A</code></p>
  
  <pre><code>COL_NAME DATATYPE MAX_LENGTH
  A        VARCHAR   255
  B        INT        4
  C        FLOAT      8
  </code></pre>
  
  <p>I want to create A,B,C as column in <code>TAB_B</code> with <code>DATATYPE</code> and <code>MAX_LENGTH</code>.</p>
  
  <p>The <code>TAB_B</code> columns look like this: Before </p>
  
  <pre><code>X Y Z
  </code></pre>
  
  <p>I want the <code>TAB_B</code> look like this: After </p>
  
  <pre><code>X Y Z A B C
  </code></pre>
  
  <p>with datatype.</p>
  
  <p>How can I write dynamic SQL so my A,B,C,... columns will get created in existing table.</p>