title: Is it possible to query for a specific data type?
body: <p>I was wondering if it is possible to write a query that returns a field only if that field contains a certain data type.</p>
  
  <p>So for example, I could want to return all fields with data type VARCHAR from a search, or data type BIGINT. Not just search for fields that contain numbers or letters.</p>
  
  <p>Here is an example of my psuedo code: (I know it's not very impressive):</p>
  
  <pre><code>select *
  from dbo.REP_ALIAS ra
  where ra.TRADE_REP [= data type integer] --integer is just an example
  </code></pre>
  
  <p>Is there some way to do this for all data types, not just integer.</p>
  
  <p>Also: I am using T-SQL with MS SQL Server 2008 R2.</p>