title: How to cast a column e.g (WRS.WidgetSubCategoryName as WidgetSubCategory) in sql server
body: <p>I'm trying to <code>CAST</code> column in my database table, I saw other example that shows how you can cast columns in SQL Server. This is the syntax </p>
  
  <pre><code>CAST (expression AS data_type) 
  </code></pre>
  
  <p>e.g. </p>
  
  <pre><code>CAST(WidgetName AS VARCHAR(50))
  </code></pre>
  
  <p>How can I cast <code>(WRS.WidgetSubCategoryName as WidgetSubCategory)</code>?</p>
  
  <p>Your help will be highly appreciated.</p>
  
  <p>Thanks</p>