title: Cast datatype with variable
body: <p>Is it possible in T-SQL to cast a data type with a variable type? </p>
  
  <p>I.e. Though this won't work since it expects a string literal but gets the gist across: </p>
  
  <pre><code>select @DataType = Data_Type
  from INFORMATION_SCHEMA.COLUMNS
  where TABLE_NAME = 'emp'
  and COLUMN_NAME = 'emp_id'
  
  SELECT
  cast(emp_id as @DataType)
  FROM emp
  </code></pre>