title: SQL Server query to get data type for all columns in table?
body: <p>I have this SQL Server 2012 query that I am running in SSMS:</p>
  
  <pre><code>SELECT name, max_length, precision, scale, is_nullable 
  FROM sys.columns
  WHERE object_id = OBJECT_ID('dbo.testtable')
  </code></pre>
  
  <p>It is returning what I want:</p>
  
  <p><a href="https://i.stack.imgur.com/Qhoyg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Qhoyg.png" alt="enter image description here"></a> </p>
  
  <p>However, I would like to add the data type of the column in this query, so that it looks like what I see in the object explorer. Any thoughts on how to add the data type?</p>
  
  <p><a href="https://i.stack.imgur.com/2YBF5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/2YBF5.png" alt="enter image description here"></a></p>