title: How to do ForEach on user defined table type in SQL Server stored procedure?
body: <pre><code>XX PROCEDURE [dbo].[XXX]
      @X dbo.IntType readonly
  AS
  BEGIN
      SET NOCOUNT ON;
      // how can I foreach(@X) here and do process individually?
  END
  </code></pre>
  
  <p><code>IntType</code> is a user-defined table type</p>
  
  <pre><code>CREATE TYPE [dbo].[IntType] AS TABLE(
      [T] [int] NOT NULL,
      PRIMARY KEY CLUSTERED 
  (
      [T] ASC
  )
  </code></pre>
  
  <p>I need to use this in SQL Azure, please advice.</p>