title: Define a table type parameter
body: <p>I just try to create a table type parameter called "ListOfName", and set a parameter of such type in my procedure. But an error incurred:</p>
  
  <blockquote>
    <p>Must declare the scalar variable "@Table_Name_List"</p>
  </blockquote>
  
  <p>But I declare  </p>
  
  <pre><code> CREATE TYPE ListOfName AS TABLE (Table_Name nvarchar(50) );
  
   CREATE PROCEDURE spTest 
      @Table_Name_List    ListOfName   READONLY
  
   AS
      SELECT * from dbo.Table_Size_Daily
  
      WHERE    Table_NAME IN (@Table_Name_List) 
   Go
  </code></pre>
  
  <p>If I add a statement before the definition chunk,</p>
  
  <pre><code> DECLARE @Table_Name_List  AS ListOfName;
  </code></pre>
  
  <p>The error was:</p>
  
  <blockquote>
    <p>The variable name '@Table_Name_List' has already been declared.
    Variable names must be unique within a query batch or stored
    procedure.</p>
  </blockquote>
  
  <p>How can I fix it? Thanks a lot</p>