title: How to list the source table name of columns in a VIEW (SQL Server 2005)
body: <p>Just wondering how to list column name and table name in one query for a view.</p>
  
  <p>For example:</p>
  
  <p>A view named as <code>viewC</code>, create by <code>tbl1 inner join tbl2</code>, contain <code>a,b,c,d</code> columns (<code>a,b</code> from <code>tbl1</code> and <code>c,d</code> from <code>tbl2</code>).</p>
  
  <p>How to </p>
  
  <pre><code>Select COLUMN_NAME, DATA_TYPE, column_default, character_maximum_length, sourceTableNAME 
  FROM information_schema.columns 
  where table_name='viewC'
  </code></pre>
  
  <p>together?</p>