title: User-defined Data Type and #temp table
body: <p>In the SQL Server 2008 database I have a user-defined data type. In one of stored procs I was going to use that type as a column type of temp table, like:</p>
  
  <pre><code>CREATE TABLE #SomeTable
  (
      [some_column] UDT_SomeType,
      -- other columns 
  )
  </code></pre>
  
  <p>Apparently my attempt failed, because, as far as I googled, my <code>UDT_SomeType</code> does not exist in <code>tempdb</code> (where temp table is actually stored). </p>
  
  <p>The <code>UDT_SomeType</code> is actually <code>NUMERIC(19,9)</code>, so I can use the following workaround for now:</p>
  
  <pre><code>CREATE TABLE #SomeTable
  (
      [some_column] NUMERIC(19,9),
      -- others columns  
  )
  </code></pre>
  
  <p>However I don't think it is a really good solution. Is there any kind of best practice which can be applied here?</p>