title: SQL problem with error "Invalid data type"
body: <p>Using SQL 2008</p>
  
  <p>So I created a User Defined type:</p>
  
  <pre><code>CREATE TYPE dbo.ServiceType AS TABLE (
  [TO_ZONE] varchar(30) NOT NULL,
  [FROM_ZONE] varchar(30) NOT NULL,
  [RATE] decimal(14,2) NOT NULL,
  [SERVICE_TYPE] varchar(255) NOT NULL
  );
  </code></pre>
  
  <p>And when I try to use it I get the error "parameter or variable @variableName has an invalid data type"</p>
  
  <pre><code>ALTER PROCEDURE [dbo].[ImportServiceTypeRates]
  
  (@ServiceTypes dbo.ServiceType)  --I have tried it without the "dbo." as well
  </code></pre>
  
  <p><strong>Update</strong></p>
  
  <p>So I added "READONLY" to my variable declaration</p>
  
  <pre><code>@ServiceTypes dbo.ServiceType READONLY
  </code></pre>
  
  <p>And I now get the error "The parameter @Servicetype cannot be declared READONLY because it is not a table-valued parameter"  ?WHAT?  </p>
  
  <p>I thought the "CREATE TYPE ServiceType as TABLE" was what declared it such???</p>
  
  <p>I also have showing in Types\User-Defined Table Types\dbo.ServiceType</p>